• 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
NSUserCancelledError and the Dock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUserCancelledError and the Dock


  • Subject: NSUserCancelledError and the Dock
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Mon, 23 Feb 2009 20:56:58 +0700

I have a document based Cocoa app which uses:
- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError


This app checks the content of "absoluteURL" and if this content is not nice, shows a Panel:
"Content of ... is not nice. Cancel - Open Anyway.
When the user clicks cancel I return NSUserCancelledError.
Works perfectly.


But when I drag the same un-nice file to the image of my app in the Dock, I get the same panel, again I click "Cancel" but then I get another (unwanted) Panel:
"The document "..." could not be opened. The operation was cancelled. "Ok"


It is silly and quite pointless to tell me that an operation was cancelled, when I just have clicked "Cancel" in the previous panel.
And: I did return NSUserCancelledError because I was told, if "you don't want an error alert to be presented to the user, return an error object whose domain is NSCocoaErrorDomain and whose code is NSUserCancelledError."


So: what can I do to make the Dock respect this convention?
10.5.6

Kind regards,

Gerriet.

_______________________________________________

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


  • Prev by Date: Re: Unexpected mouse-handling behaviour
  • Next by Date: object wrapper for an opaque pointer
  • Previous by thread: Re: iTunes like transition?
  • Next by thread: object wrapper for an opaque pointer
  • Index(es):
    • Date
    • Thread