XCode 4 Break on Exception

Discussion in 'iOS Programming' started by MaxFreud, May 4, 2011.

  1. macrumors newbie

    Jan 5, 2011
    Hi all,

    I have set a break on exception in XCode 4, but my problem is that the debugger breaks without telling me what line of code was the culprit. I can see the method names in the Debug Navigator, so for example I know the problem came from a call to [NSString substringFromIndex:] but there are a number of calls to that, and I have no idea which one causes the problem.

    Any ideas on how to get XCode to actually indicate the break location?

  2. macrumors regular

    Oct 18, 2007
    Isn't the stack visible? If it is, follow it back to your code. It's probably in there.

    I happen to have some code that is throwing an exception, and I can see the entire stack backtrace. Two kinds of entries show up, dark ones (which are your code) and light grey ones (which are not).
  3. macrumors 65816


    Dec 29, 2010
    Aartselaar // Antwerp // Belgium
    If u have a breakpoint, then u can see in the debugger, in Xcode 4 that's at the bottom, if it isn't there, expand the window a bit up, so it's visible.
    Then if it breaks at the line, press continue.. and u can see the values, where it's exactly, and if it breaks, it should be visible too :)

    regards, Noxx

Share This Page