Re: Customizing how errors are presented
Re: Customizing how errors are presented
- Subject: Re: Customizing how errors are presented
- From: Jerry Krinock <email@hidden>
- Date: Fri, 19 Feb 2010 09:29:18 -0800
On 2010 Feb 19, at 07:55, Dado Colussi wrote:
> I would like to customize how errors in controls like NSTextField
> are presented. The documentation for NSResponder recommends overriding
> -willPresentError: in order to customize error presentation. However, that
> doesn't let me customize *how* the error will be presented to the user. I am
> unhappy with the alerts because they interfere with the interaction by
> demanding immediate user attention.
From Apple's "Document-Based Applications Overview":
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. The Application Kit presents errors through
the NSApplication implementations of the presentError: and
presentError:modalForWindow:delegate:didPresentSelector:contextInfo:
methods declared by NSResponder. Those implementations silently
ignore errors whose domain is NSCocoaErrorDomain and whose code is
NSUserCancelledError.
_______________________________________________
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