Install Unhandled Exception Filters for Mac OS X

Windows has the SetUnhandledExceptionFilter API, which allows applications to handle crashes. Is there something similar for the Mac platform? I did not find anything like it on developer.apple.com ...

Thanks!

+3
source share
2 answers

The equivalent of Cocoa / Foundation is the NSSetUncaughtExceptionHandler () function . You should also check the "Manage program response to exceptions" in the Cocoa Exception Handling Guide. It will explain some default changes you can make your application take specific, predefined actions when an NSApplication object wants to complete with an exception.

+3
source

Check out Smart Crash Reports and how it works. Be warned that this is a really evil hack.

+3
source

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


All Articles