I saved an array using the following code:
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myArray];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"myArray"];
What is the code to load it back into memory?
I saved an array using the following code:
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myArray];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"myArray"];
What is the code 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"];