The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   Omni Frameworks (http://forums.omnigroup.com/forumdisplay.php?f=16)
-   -   Assertion exceptions (http://forums.omnigroup.com/showthread.php?t=11693)

tslarkin 2009-03-22 04:50 AM

Assertion exceptions
 
My application's response to assertion failures has changed recently, and I'm reasonably sure that the change started when I added Omni frameworks.

Instead of invoking the debugger, a beautifully formatted notice appears in the console, showing the assertion error, the object, line number, stack trace, and other useful information. However, I'd really prefer to be in the debugger, so that I could examine what's happening at the point of failure.

Is this new behavior a result of adding the Omni frameworks? And if so, how can I restore the original behavior?

Tim Wood 2009-03-23 07:18 AM

Yes; if you use OFController, by default it gets set up as the NSExceptionHandler delegate and the main-thread's NSAssertionHandler.

If you'd like to avoid this, you can modify -[OFController init] to suite your needs. Alternatively, you can just set breakpoints OBAssertFailed. This should get called as part of the NSAssertionHandler path as well as the OmniBase assertions.

For example, if you search for "handleFailureInMethod:" in OFController.m, you'll see it format up the message and then call OBAssertFailed, of if your OFController subclass specifies it, crash immediately.


All times are GMT -8. The time now is 04:22 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.