Re: Dictionary won't write to disk
Re: Dictionary won't write to disk
- Subject: Re: Dictionary won't write to disk
- From: Dave DeLong <email@hidden>
- Date: Wed, 8 Jun 2005 21:51:36 -0500
On Jun 8, 2005, at 9:07 PM, Andy Lee wrote: On Jun 8, 2005, at 9:49 PM, Dave DeLong wrote:
if ([myDictionary writeToFile:[@"~/Desktop/Songs.xml" stringByExpandingTildeInPath] atomically:NO]) {}
The docs for that method say: "If path contains a tilde (~) character, you must expand it with stringByExpandingTildeInPath before invoking this method."
Unfortunately, nothing is happening! I've tried many different things like
Did you look at the return value of the method call? If it returned YES, this would have been more puzzling, but a return value of NO might have led you to look at the docs to see what might cause the method to return NO. (Yes, I know this is 20/20 hindsight...)
It might be worth filing a bug request for a version of the method that returns an NSError like NSString's writeToFile method does.
OK, that's good to know. However, when I do:
NSURL *temp = [NSURL fileURLWithPath:[@"~/Desktop/Songs.xml" stringByExpandingTildeInPath]]; if ([myDictionary writeToURL:temp atomically:YES] == YES) { NSLog(@"worked"); } else { NSLog(@"failed"); }
it always outputs "failed".
Any other ideas?
Thanks!
Dave
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden