Re: [NSApp presentError:error] & Custom Icon ...

2009-05-27 Thread Jerry Krinock


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 (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[NSApp presentError:error] & Custom Icon ...

2009-05-19 Thread Mic Pringle
Hi,

Is it possible to use an icon other than the applications when using
[NSApp presentError:error] ?

I'm open to all suggestions.

Thanks

-Mic
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com