Unable to save file in Document-Based Application
Unable to save file in Document-Based Application
- Subject: Unable to save file in Document-Based Application
- From: cocoa learner <email@hidden>
- Date: Sun, 5 Apr 2009 18:21:00 +0600
Hi All,
I am new to cocoa and GUI programming.
I wrote a Document-Based Application. Whose code snippet as follows to write
data into a file (this code is taken from
Aaron.Hillegass-Cocoa.Programming.for.Mac.OS.X
book's Chapter 10 ) -
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
NSLog(@"dataOfType : Called");
NSData *data = [NSKeyedArchiver archivedDataWithRootObject: employees];
if (data == nil)
{
NSLog(@"dataOfType : Failed to write into file");
}
else
{
NSLog(@"dataOfType : Data is written into file");
}
NSLog(@"dataOfType : Finished");
return data;
}
But this code piece is not saving the data into file. Does any one have any
clue why it's not able to create file?
Regards
Cocoa.learner
_______________________________________________
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