• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating a file using NSURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Creating a file using NSURL (From: Quincey Morris <email@hidden>)

  • Prev by Date: CGWarpMouseCursorPosition and large delta/offset at next mouse motion event
  • Next by Date: iOS additional sharing options (context menu)
  • Previous by thread: Creating a file using NSURL
  • Next by thread: CGWarpMouseCursorPosition and large delta/offset at next mouse motion event
  • Index(es):
    • Date
    • Thread