How do I catch global exceptions?

后端 未结 1 949
闹比i
闹比i 2021-01-13 23:51

Is there a way to catch global \"crashing\" app exceptions like objc_exception_throw, EXC_ARITHMETIC etc. in code? I need that because I want to do some thi

相关标签:
1条回答
  • 2021-01-14 00:23

    You can set a handler for any uncaught exception by using NSSetUncaughtExceptionHandler.

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

    0 讨论(0)
提交回复
热议问题