Possible Duplicate:
How to store custom objects in NSUserDefaults
HI, How can i store NSMutable array in NSUserDefaults? regards shishir
Possible Duplicate:
How to store custom objects in NSUserDefaults
HI, How can i store NSMutable array in NSUserDefaults? regards shishir
Storing the array is as easy as:
NSMutableArray *array = [NSMutableArray array];
[[NSUserDefaults standardUserDefaults] setObject:array forKey:@"array"];
but every object in the array must be a property-list object. That is, they must be one of:
If you want to store instances of other classes in a property list, you must create methods to serialize/deserialize them to and from one of these types. Serializing objects to dictionaries is a common approach.
EDIT: Another approach is shown here: How to store custom objects in NSUserDefaults