Re: coding struct with keyed archivers
Re: coding struct with keyed archivers
- Subject: Re: coding struct with keyed archivers
- From: Jim Correia <email@hidden>
- Date: Wed, 15 Jan 2003 08:15:40 -0500
On Wednesday, January 15, 2003, at 07:40 AM, Simon Bovet wrote:
How can I encode a NSValue with e.g. NSPoint value into a
NSKeyedArchiver? When trying it straightforward:
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[[NSKeyedArchiver alloc]
initForWritingWithMutableData:data] autorelease];
[archiver encodeObject:[NSValue valueWithPoint:NSZeroPoint]
forKey:@"Point"];
[archiver finishEncoding];
I get the following error:
exception: *** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this
archiver cannot encode structs
Do I really need to subclass NSValue? Why can't structs be key
archived?!?
NSKeyedArchiver doesn't support archiving structs. The reasons why are
discussed in the foundation release notes.
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.