Maybe somebody knows where is the "Run > Stop on Objective-C exception" menu in Xcode 4? I've used it sometimes in Xcode 3, but it disappeared in the new IDE.
3 Answers
In the left side column of xcode 4:
- tap on the breakpoint tab (the 6th tab over)
- tap on the + button in the bottom left of the window
- tap 'add exception breakpoint'
- tap 'done' on the popup
Someone else told me this, and I'm adding it here so I can favorite this question and have a useful reference to look back on.
Set the objc exception breakpoint action to po $eax and you'll usually get the handy-dandy exception message right there in the debugger window when it breaks.
-
1This is a great tip but $eax only works on the simulator (x86) code. The register on the device (ARM) is different.– jsdOct 29, 2012 at 21:02
-
-
-
if i'm understanding this article correctly, the register for ARM is either $r0 or $r1, depending on what threw the exception. sealiesoftware.com/blog/archive/2008/09/22/…– ericsocoFeb 10, 2013 at 23:33
-
more on this here, under "Printing CPU registers" nachbaur.com/blog/basics-xcode-debugging-tips– ericsocoFeb 11, 2013 at 6:05