views:

47

answers:

2
[[NSUserDefaults standardUserDefaults] setObject:myArray forKey:@"myArray"];

I'm trying to figure out how to save and load an array using NSUser Defaults. I already have the NSCoding delegate methods defined, just need to know the actual commands to execute that will call those methods.

+3  A: 

The posted code stores the array:

In your case you'll want to store it using -setObject:forKey: and retrieve it using -arrayForKey:.

Georg Fritzsche