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 protected])

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 [EMAIL PROTECTED]

Reply via email to