Re: Keyed Archiving.
Re: Keyed Archiving.
- Subject: Re: Keyed Archiving.
- From: Tony Parker <email@hidden>
- Date: Tue, 4 Dec 2007 13:47:52 -0800
Howdy,
Maybe you're looking for [NSKeyedArchiver archiveRootObject:toFile:]
instead?
http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Tasks/creating.html
- Tony
On Dec 4, 2007, at 1:15 PM, Development wrote:
I'm creating a program that is project based similar in ways to
XCode. Thus when a new project is created I need to automatically
have the application create the default project document.
For this, once I have the path I use: [NSArchiver
archiveRootObject:newDoc toFile:[NSString stringWithFormat:@"%@/
%@.arcproj",destination,[destination lastPathComponent]]];
I assumed this would automatically archive the default document.
however, when I attempt to create a new project I get this error message:***
-encodeObject:forKey: only defined for abstract class. Define -
[NSArchiver encodeObject:forKey:]!
Which I simply do not understand. The error does not make sense to
me.
The NSDocument subclass has the following encodeWithCoder override:
-(void)encodeWithCoder:(NSCoder*)coder
{
NSLog(@"CAlling encode with coder %@",coder);
//It fails here before encoding or writing anything to disk. the
above NSLog prints but nothing else happens.
[coder encodeObject:projectDict forKey:@"ProjectDict"];
[coder encodeObject:projectStruct forKey:@"ProjectStruct"];
[coder encodeObject:_root forKey:@"ROOT"];
NSLog(@"Reached end of encode");
}
_______________________________________________
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
_______________________________________________
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