You have to set up how you will save your files first, this is not core data.
You will have to, for example, create an array that will hold the objects that you will be archiving and unarchiving to. Then you will have to modify the dataOfType and readFromData methods: - (id)init { self = [super init]; if (self) { objectsToArchive = [[NSMutableArray alloc] init]; selection = [[NSMutableArray alloc] init]; } return self; } - (void)dealloc { [objectsToArchive release]; [selection release]; [super dealloc]; } - (void)addObject : (id)object { if(![objectsToArchive containsObject:object]) { [objectsToArchive addObject:object]; } } - (void)removeObject : (id)object { [objectsToArchive removeObject:object]; } - (void)setObjects : (NSMutableArray*)objects { [objects retain]; [objectsToArchive release]; objectsToArchive = objects; } - (NSArray*)objects { return objectsToArchive; } - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { if ( outError != NULL ) { *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code: unimpErr userInfo:NULL]; } return [NSKeyedArchiver archivedDataWithRootObject:[self objects]]; } - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { if ( outError != NULL ) { *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code: unimpErr userInfo:NULL]; } NSArray * arrayWithDataFromFile = [NSKeyedUnarchiver unarchiveObjectWithData:data]; NSMutableArray * mutableArrayWithDataFromFile = [arrayWithDataFromFile mutableCopy]; [self setObjects: mutableArrayWithDataFromFile]; [mutableArrayWithDataFromFile release]; return YES; } On Thu, Feb 26, 2009 at 11:05 PM, Richard Somers <rsomers.li...@infowest.com > wrote: > An application built using the standard unmodified "Cocoa Document-based > Application" template produces an error when saving. The error message is > "The document "Untitled" could not be saved as "newname.????". > > This happens on my PPC and Intel machines. > > Does anyone else have this problem? > > Mac OS X 10.5.5 > Xcode 3.1.1 > > Richard _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com