iOS Reference Library Apple Developer
Search

Uncaught Exceptions

If an exception is not caught, it is intercepted by a function called the uncaught exception handler. The uncaught exception handler always causes the program to exit but may perform some task before this happens.

The default uncaught exception handler logs a message to the console before it exits the program. On Mac OS X, if the application was launched from the shell, the log messages are sent to the Terminal window.

You can set a custom function as the uncaught exception handler using the NSSetUncaughtExceptionHandler function; you can obtain the current uncaught exception handler with the NSGetUncaughtExceptionHandler function.

Note: Exceptions on the main thread of a Cocoa application do not typically rise to the level of the uncaught exception handler because the global application object catches all such exceptions.




Last updated: 2010-02-24

Did this document help you? Yes It's good, but... Not helpful...