I want to store an array with NSUserDefault, then, I put in applicationDidEnterBackground
[[NSUserDefaults standardUserDefaults] setObject:myArray forKey:@"myArray"];
and in application didFinishLaunchingWithOption
myArray= [[NSMutableArray alloc]
initWithArray:[[NSUserDefaults standardUserDefaults]
objectForKey:@"myArray"]];
it’s ok for multitasking device, but for not-multitasking device, how can I solve?
Store the object in
NSUserDefaultsin-applicationWillTerminate:, if it hasn’t already been saved by the invocation of-applicationDidEnterBackground:(i.e. check if multitasking is supported, if it is, then don’t save it because it’s already been saved.)