overriding NSObject initWithCoder/encodeWithCoder category?
overriding NSObject initWithCoder/encodeWithCoder category?
- Subject: overriding NSObject initWithCoder/encodeWithCoder category?
- From: Greg Best <email@hidden>
- Date: Thu, 13 Sep 2007 00:27:26 -0700
Are there any reasons not to include these functions in a category on
NSObject?:
-(id)initWithCoder:(NSCoder*)decoder
{
return [self init];
}
-(void)encodeWithCoder:(NSCoder*)coder
{
return;
}
The compiler always warns that those functions may not be supported,
but I know if I ever change my superclass I'll forget to update the
coding routines...
One obvious reason, I guess, is that Apple may choose to implement
these methods in the future, causing a conflict... Who wins a
conflict like that?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden