Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yalag

Suspended
Original poster
Nov 18, 2007
1,448
81
So far all the persistence data for my app has been done with plist which accepts id of a basic type (NSNumber, NSDate etc). What is the best way to save a NSArray of Object, of which the object has members of a lot of data? Do I have to save each member manually or is there a neat way of saving objects?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You can use NSKeyedArchiver and NSKeyedUnarchiver to save/load an object that conforms to the NSCoding protocol into an NSData object, which can then be inserted into a property list.
 

yalag

Suspended
Original poster
Nov 18, 2007
1,448
81
You can use NSKeyedArchiver and NSKeyedUnarchiver to save/load an object that conforms to the NSCoding protocol into an NSData object, which can then be inserted into a property list.

ah thank you. so just have to use plist either way for iphone data? Or can you just use the archiver to save to disk directly?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.