Re: Halting a cocoa application?
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