I'm working on a document-based app without CoreData. I have a class Player, which is a subclass of NSObject. The class has some variables and I have also properly implemented - (id)initWithCoder:(NSCoder *)coder
and - (void)encodeWithCoder:(NSCoder *)coder
methods. That's how I'm archiving my data:
- (NSData *) dataOfType:(NSString *)aType
error:(NSError **)outError
{
return [NSKeyedArchiver archivedDataWithRootObject:players];
}
(players is an NSMutableArray
holding some instances of the Player class). The saving works absolutely fine. What I would like to know is how I can also archive (and unarchive later) some variables, declared in the Document.h file?