Re: [basic] writeToFile .plist best method
Re: [basic] writeToFile .plist best method
- Subject: Re: [basic] writeToFile .plist best method
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 28 Jul 2004 08:44:34 -0600
On Jul 28, 2004, at 1:53 AM, clunkyrobot wrote:
1- do I need to call my file a somefile.plist can I just give it my
own extension like somefile.myfile?
The extension shouldn't matter in this case.
noting that records is a dictionary.
[records writeToFile:[ [ [@"~/Desktop/"
stringByAppendingString:fileName] stringByAppendingString:@".plist"]
stringByExpandingTildeInPath ] atomically:TRUE];
Is this the best way, just incase I have to many square braces?
You don't have to many square braces, but you do have too many square
braces. <;*) Try this instead:
[records writeToFile:[[NSString stringWithFormat:@"~/Desktop/%@.plist",
fileName] stringByExpandingTildeInPath] atomically:YES];
Or this:
[records writeToFile:[NSString stringWithFormat:@"%@/Desktop/%@.plist",
NSHomeDirectory(), fileName] atomically:YES];
Either way is much cleaner and does the same thing as you wrote above.
Nick Zitzmann
<
http://www.chronosnet.com/>
_______________________________________________
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.