Re: App Will Not Terminate After Uncaught Excpetion
Re: App Will Not Terminate After Uncaught Excpetion
- Subject: Re: App Will Not Terminate After Uncaught Excpetion
- From: Andreas Grosam <email@hidden>
- Date: Fri, 17 Dec 2010 09:25:02 +0100
> Look up NSExceptionHandler.
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Exceptions/Tasks/ControllingAppResponse.html
>
> --Kyle Sluder
The Exception-handling framework let you define the "logging and handling behavior for all uncaught exceptions, system-level exceptions, and runtime errors in all applications".
So, as stated, the framework may be used to affect these "Application Errors":
• uncaught NSExceptions
• system-level exceptions (such as invalid memory accesses)
• Objective-C runtime errors (such as messages sent to freed objects)
However, NSExceptions thrown in the main thread, and not caught by any lower level handler or not handled by custom handlers - make their way through to the top level handler which is installed by AppKit:
"Exceptions on the main thread of a Cocoa application are caught by the top-level handlers, which are usually installed by the Application Kit."
These *caught exceptions* do not fall under the category of "Application Errors" which are handled by the Exception-handling framework. So, the Exception-handling framework does not affect the behavior of these exceptions caught by NSApp. And NSApp does not handle these exceptions in any way - it just consumes or ignores them.
Andreas_______________________________________________
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