NSCoder encodeX:forKey vs encodeX:
NSCoder encodeX:forKey vs encodeX:
- Subject: NSCoder encodeX:forKey vs encodeX:
- From: Andrew White <email@hidden>
- Date: Fri, 15 Apr 2005 12:49:44 +1000
In general, will a coder that doesn't support keyed coding degenerate
encodeX:forKey: to encodeX:, or do I need to follow the example in
.../Cocoa/Conceptual/Archiving/index.html and provide both?
If this isn't provided by default, is anything going to break if I do the
following?
@implementation NSCoder (SomeName)
- (void) encodeObject: (id) objv forKey: (NSString *) key
{
[self encodeObject: objv];
}
// Insert equivalents here
@end
It seems the above should allow each encodeX:forKey: call to degenerate to
an appropriate encodeX: call (or encodeValueOfObjCType: "X" at: objv ).
Have I missed something?
Decoding is obviously less simple, since it must be decoded in the same
order as it is encoded.
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments may be confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden