Saving an object to a file
Saving an object to a file
- Subject: Saving an object to a file
- From: Marco Michieli <email@hidden>
- Date: Mon, 26 Apr 2004 21:14:49 +0200
I'm trying to save a simple string with the following method (actually
I want to save another object that conforms to NSCoding, but I'm just
experimenting with a simple string):
- (IBAction)saveString:(id)sender
{
BOOL result = [NSKeyedArchiver archiveRootObject:[NSString
stringWithString:@"Try to save this string"]
toFile:@"~/Desktop/MyString"];
NSLog(@"saveString result: %d (1=YES, 0=NO)", result);
}
But it doesn't work!
This is the log:
2004-04-26 20:56:50.362 MyApp[532] saveString result: 0 (1=YES, 0=NO)
I don't understand what's wrong with this simple code: I'm probably
missing something obvious, but I can't figure out what...
Thanks for your help
Marco
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.