Keyed Archiving.
Keyed Archiving.
- Subject: Keyed Archiving.
- From: Development <email@hidden>
- Date: Tue, 4 Dec 2007 14:15:42 -0700
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