• 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: Halting a cocoa application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Halting a cocoa application?


  • Subject: Re: Halting a cocoa application?
  • From: Nathan Kinsinger <email@hidden>
  • Date: Sat, 24 May 2008 18:38:55 -0600


On May 24, 2008, at 6:12 PM, Graham Reitz wrote:

What is the preferred method to halt a cocoa application on a runtime error occurring in the initWithFrame method?

thanks,
graham

I would normally try to alert the user that something went wrong and then terminate if that is the only option (try to give the user a chance to fix something, it might be as simple as allowing them to open a new document). In which case I would return nil and catch that in the controller object (if you have one) which would then display the alert (or a sheet).


Once you do want to terminate then [NSApp terminate:nil] will do the trick.

--Nathan
_______________________________________________

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: 
 >Halting a cocoa application? (From: Graham Reitz <email@hidden>)

  • Prev by Date: Re: How many times will a sub-classed NSView be instantiated in a simple Cocoa App?
  • Next by Date: Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
  • Previous by thread: Halting a cocoa application?
  • Next by thread: Re: Halting a cocoa application?
  • Index(es):
    • Date
    • Thread