Your most important breakpoint in Cocoa
August 20th, 2008 at 5:29 pm (trackback)
…..drumroll please…and it is…is: objc_exception_throw. You should always have this breakpoint setup in any Cocoa or Cocoa Touch app that you are building.
How do you do it? In Xcode, Run -> Show -> Breakpoints and double click on a new breakpoint. Type it in, ie:

Exceptions in cocoa are, well, exceptional. If your app is throwing them, then you should fix them.
This entry was posted
on Wednesday, August 20th, 2008 at 5:29 pm and is filed under Cocoa.
You can follow any responses to this entry through the
RSS 2.0 feed.
You can skip to the end and leave a response. Pinging is currently not allowed.
August 26th, 2008 at 10:49 am
I always break on raise, but there are instances where that doesn’t quite work and this might be better. Thanks!
August 26th, 2008 at 10:59 am
Yes — breaking on -raise (or, specifically, -[NSException raise]) worked great in Tiger, but would sometimes miss a few exceptoins. In Leopard or higher it won’t get hit at all, and objc_exception_throw is the single funnel point for all exceptions. Ideally, this should be a default breakpoint places in all project templates.
August 27th, 2008 at 12:52 pm
“In Leopard or higher it won’t get hit at all”
Huh. Why is that? Why the change?
This is good to know! Thanks.
August 28th, 2008 at 9:03 am
Basically, before there may have been multiple ways an exception could be thrown. I don’t know the exact details. The thing to understand now is that there is a single funnel point for them all, which makes breaking on any exception much easier!
August 28th, 2008 at 3:45 pm
Okay, cool. I’ve been using break on [NSException raise] since EOF on NeXTSTEP 3.2, so I was wondering what the change was.