NSCoding protocol question
问题 I want to add the archiving (NSCoding) protocol to my model class, and then i implement both methods encodeWithCoder:(NSCoder*)coder and initWithCoder:(NSCoder*)coder . MyModelClass has 2 instance variables (NSString and NSImage), so i use the encodeObject:(id)object forKey:(NSString*)string method to encode the object plus the value for particular key. But i keep got the error : *** -encodeObject:forKey: only defined for abstract class. Define -[NSArchiver encodeObject:forKey:]! here's my