How to get global exceptions?

Is there a way to catch the global β€œcrash” of applications like objc_exception_throw, EXC_ARITHMETIC, etc. in code? I need this because I want to do something before the application is killed by the system.

+4
source share
1 answer

You can set a handler for any uncaught exception with the NSSetUncaughtExceptionHandler .

Related documents from Apple are here: http://developer.apple.com/mac/library/documentation/cocoa/conceptual/Exceptions/Concepts/UncaughtExceptions.html#//apple_ref/doc/uid/20000056-BAJDDGGD

+10
source

Source: https://habr.com/ru/post/1309656/


All Articles