Month: November 2011

[iOS]How to save and load a custom object?

Here we go. How to write a custom object which can be archived to a text file? Usually, we use NSKeyedArchiver to serialize an object and write it to a file. Correspondingly, NSKeyedUnarchiver is used to get the object from the file. The NSKeyedArchiver’s interface is like this: + (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path; NSKeyedArchiver is a