• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Keyed Archiving.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Keyed Archiving.
      • From: Tony Parker <email@hidden>
  • Prev by Date: Problem while taking the Low-level Core Data Tutorial
  • Next by Date: Re: How to Make a Very Thin Window?
  • Previous by thread: Problem while taking the Low-level Core Data Tutorial
  • Next by thread: Re: Keyed Archiving.
  • Index(es):
    • Date
    • Thread