NSUserCancelledError and the Dock
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