I have noticed that the saving of NSUserDefaults takes a while.
How can I check if it has finished saving?
for example I do:
NSMutableArray *uld = [NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"testdata"]];
[uld addObject:teststring];
[[NSUserDefaults standardUserDefaults] setObject:uld forKey:@"testdata"];
You normally don’t have to worry about
NSUserDefaultsit will store changes whenever there is time, if you need to make sure a changes has been written to disk call- (BOOL) synchronise, it will returnYESif the defaults were correctly written to disc.See the NSUserDefaults reference page at Apple