• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [NSApp presentError:error] & Custom Icon ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >[NSApp presentError:error] & Custom Icon ... (From: Mic Pringle <email@hidden>)

  • Prev by Date: Re: NSString initWithFormat and stringWith
  • Next by Date: Re: Core data, bindings and multiple view NIB
  • Previous by thread: [NSApp presentError:error] & Custom Icon ...
  • Next by thread: When init returns nil does it cause a leak
  • Index(es):
    • Date
    • Thread