Re: Creating a file using NSURL
Re: Creating a file using NSURL
- Subject: Re: Creating a file using NSURL
- From: Tomas Franzén <email@hidden>
- Date: Thu, 16 Feb 2012 10:47:23 +0100
On 16 feb 2012, at 07:18, Quincey Morris wrote:
>> Error Domain=NSCocoaErrorDomain Code=4 "The file “[…]” doesn’t exist." UserInfo=0x400f252c0 {NSFilePath=/Volumes/[…], NSUnderlyingError=0x400f25140 "The operation couldn’t be completed. No such file or directory"}
>
> IOW, NSData is reporting the "wrong" error, as this message isn't helpful to present to the user.
> Is there another API I should be using that will producing an error saying that the file couldn't be created -- or better still saying *why* the file couldn't be created? Does the misleading error message count as a bug in -[NSData writeToURL:error:]?
Try looking at the underlying error (NSUnderlyingErrorKey in userInfo). That might contain something more useful.
Tomas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden