On 14 Jul 2009, at 01:22, DKJ wrote:
I've defined my own MyClass and made it conform to the NSCoding
protocol by adding methods like this:
- (void)encodeWithCoder:(NSCoder *)encoder
{
[encoder encodeInt:index forKey:@"index"];
}
- (id)initWithCoder:(NSCoder *)decoder
{
self = [super init];
index = [decoder decodeIntForKey:@"index"];
return self;
}
Slightly separate to the question, have you actually declared that
your class conforms to the protocol, or just implemented the methods?
i.e. the header should be something like:
MyClass : NSObject <NSCoding>
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com