"Run > Stop on Objective-C exception" in Xcode 4?
Asked Answered
O

3

63

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.

Overtax answered 10/2, 2011 at 19:38 Comment(0)
N
96

In the left side column of xcode 4:

  1. tap on the breakpoint tab (the 6th tab over)
  2. tap on the + button in the bottom left of the window
  3. tap 'add exception breakpoint'
  4. tap 'done' on the popup
Nutritive answered 1/6, 2011 at 22:15 Comment(0)
R
49

See the image It will help,

enter image description here

good luck, Naveen Shan

Roborant answered 12/10, 2011 at 8:1 Comment(0)
H
7

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.

Hurt answered 12/4, 2012 at 23:20 Comment(5)
This is a great tip but $eax only works on the simulator (x86) code. The register on the device (ARM) is different.Chur
@Chur do you know what it is?Booma
I haven't been able to figure it out.Chur
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/…Mazurek
more on this here, under "Printing CPU registers" nachbaur.com/blog/basics-xcode-debugging-tipsMazurek

© 2022 - 2024 — McMap. All rights reserved.