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: avoid AlertPanel in opening a document




On Sat, 19 Jul 2008 09:43:57 -0700, Quincey Morris <email@hidden>wrote:

On Jul 19, 2008, at 01:58, Gerriet M. Denkmann wrote:

In -readFromURL:ofType:error: of a document-based app I make some
checks and if something looks suspicious I show an AlertPanel with:
"Something strange. (Open anyway) (Do not open)"

If the user clicked on (Do not open) I return NO and set the NSError
to nil.

But then another panel comes up with "Document <name> could not be
opened. (OK)".
This is kind of silly, as the user just has clicked on (Do not open).

How can this second panel be avoided? Using 10.4.11 Tiger.

Return an error with domain=NSCocoaErrorDomain and code=NSUserCancelledError.

Works perfectly. Thanks!

Btw., this is mentioned in the "Error Handling in the Document Architecture" section of the "Document-Based Applications Overview" and also in: "Error Handling Programming Guide For Cocoa".
Very easy to find, if one knows, what terms to search for.


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

This email sent to 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.