On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:

> In Cocoa, exceptions are considered fatal errors, and code is usually not 
> exception safe.

[citation needed]

> That is, after catching an exception, it is very probable that the 
> application state is corrupted and can not be restored. So, is continuing the 
> app after an uncaught exception occurred expected behavior? 

Yes.

> Shouldn't the default behavior in Cocoa cause the app to terminate as soon as 
> possible?

No.

> But since there is no such delegate method, how can I change the default 
> behavior?
> Do I have to override NSApplication's -run method in order to terminate after 
> an uncaught exception, and if yes, how? 

See 
<https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniAppKit/OAApplication.m>
 for one such example.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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

Reply via email to