Saving to the home folder
Saving to the home folder
- Subject: Saving to the home folder
- From: April Gendill <email@hidden>
- Date: Tue, 12 Aug 2003 23:37:44 -0700
I am trying to save a file to the home folder automatically.
Mostly because I'm not having any luck reading and writing to the main
bundle.
anyway.
this is the Method I'm using but it does not write anything . If I
change the path to just the root directory it works, but not if I try
to write to the home folder or anywhere else. the method is in test
mode right now, but later there will be actual data written.
- (void)saveFile:(id)sender
{
NSString *thePath=@"~/testFile.dict";
NSMutableDictionary *theDict =[[NSMutableDictionary
alloc]init];
[theDict setObject:@"Value" forKey:@"Key"];
[theDict writeToFile:thePath
atomically:YES];
}
I use a performSelector call to invoke this, although in the end it
will probably be -(void)saveFile:(NSDictionary *)aDictionary
so I can call it simply with [self saveFile]; Anyway. I must assume
that the way I'm entering the path is incorrect. So how do I get it to
write to the home folder?
_______________________________________________
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.