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: Dave Keck <email@hidden>
- Date: Thu, 16 Dec 2010 17:50:16 -0500
> Look up NSExceptionHandler.
NSExceptionHandler (and NSSetUncaughtExceptionHandler for that matter)
can't help because the exception is being caught by AppKit.
Furthermore, the NSApplication subclass technique mentioned earlier
won't work in all cases either, since some AppKit/Foundation wrap
callouts with try/catch, and don't call NSApplication's
-reportException: with the thrown exceptions. For example, an
exception thrown in the -applicationDidFinishLaunching: delegate
method simply can't be caught.
(That said, NSHandleOtherExceptionMask will allow your
NSExceptionHandler delegate method to be called for exceptions that
were caught normally, and therefore will work for cases where
exceptions are caught by AppKit. But of course, using that to
terminate your app makes the assumption that no code in your process
is using exceptions for flow control, etc. I know of one case at least
– NSConnection/NSPort – where exceptions can occur in the normal
course of execution.)
_______________________________________________
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