Re: [NSApp presentError:error] & Custom Icon ...
Re: [NSApp presentError:error] & Custom Icon ...
- Subject: Re: [NSApp presentError:error] & Custom Icon ...
- From: Jerry Krinock <email@hidden>
- Date: Wed, 27 May 2009 20:32:43 -0700
On 2009 May 19, at 07:53, Mic Pringle wrote:
Is it possible to use an icon other than the applications when using
[NSApp presentError:error] ?
Override -willPresentError: like this:
- (NSError *)willPresentError:(NSError *)error_ {
// Present the error yourself
... [beginSheet..., show alert, whatever
// This will stop Cocoa from presenting the error:
return [NSError errorWithDomain:NSCocoaErrorDomain
code:NSUserCancelledError
userInfo:nil] ;
}
I would like to say "Never allow Cocoa present an error in a shipping
app." Besides the fact that Cocoa's boldface presentation is ugly, it
isn't even any good for development, because it discards all of the
goodies you or Cocoa have put into the error's userInfo dictionary.
You'd be amazed that sometimes there's actually an explanation beneath
"Core Data could not fulfill a fault"!
_______________________________________________
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