Search code examples
objective-csavenskeyedarchiver

NSMutableArray and saving to a file


I have a class called Shop that contains data members (NSString, NSInteger and NSMutableArray that contain another class (that also has NSString and NSInteger).
Now if I use NSMutableArray to hold a list of Shops, what is the best way to save the list to a file and load it later?
Again the class Shop contains data members that is another class; both of the classes have NSString and NSInteger (maybe also NSData and NSDate).

I heard something about archiver??

Thanks.


Solution

  • Exact same as problem writing a NSMutableArray to file in cocoa

    You have non-plist objects in your array and need to use NSArchiver.