I saved an array using the following code:
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myArray];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"myArray"];
What is the c开发者_StackOverflow中文版ode to load it back into memory?
Put this where you need to load it, should work. You'll get back an immutable NSData object.
NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:@"myArray"];
精彩评论