Corbin Dunn
Redwood Monkey

Your most important breakpoint in Cocoa

Cocoa, Coding

…..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:

Picture 3 objc exception throw.png

Exceptions in cocoa are, well, exceptional. If your app is throwing them, then you should fix them.

Previous Post
Project Huchinson is alive again!
Next Post
Wake up and smell the cocoa

6
Leave a Reply

avatar
500
6 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
wooden jointsJon Hcorbincorbin Recent comment authors
  Subscribe  
Notify of
Jon H
Guest
Jon H

I always break on raise, but there are instances where that doesn’t quite work and this might be better. Thanks!

Jon H
Guest
Jon H

“In Leopard or higher it won’t get hit at all”

Huh. Why is that? Why the change?

This is good to know! Thanks.

corbin
Guest

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!

Jon H
Guest
Jon H

Okay, cool. I’ve been using break on [NSException raise] since EOF on NeXTSTEP 3.2, so I was wondering what the change was.

wooden joints
Guest
wooden joints

It’s actually a nice and helpful piece of info. I’m satisfied that you shared this useful info with us. Please stay us up to date like this. Thanks for sharing.

(c) 2008-2018 Corbin Dunn

Privacy Policy

Subscribe to RSS feeds for entries.

78 queries. 0.375 seconds.

Log in