Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dictionary won't write to disk




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Dictionary won't write to disk (From: Dave DeLong <email@hidden>)
 >Re: Dictionary won't write to disk (From: Andy Lee <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.