1

I do not understand why the exception breakpoint always goes to main.m instead of stopping exactly at the exception in the ViewController.m file.

I have tried solutions from the following links, but nothing seems to work:

Xcode always stopping at main.m after a crash

Xcode exception breakpoint doesn't print details of the exception being thrown

My case is simple: I am trying to return a string from an NSArray, but its a NSDictionary. This is why the program crashes:

[__NSDictionaryI length]: unrecognized selector sent to instance 0x608000673a40

& error description ..

See my settings in the breakpoint navigator:

enter image description here

Even i have enabled zombie state

I want the breakpoint to stop in the ViewController.m file where the exception or crash occurs. Is there any way to do this?

Community
  • 1
  • 1
  • Make Exception type from `Objective-C` to `All` and try. – ron27 Apr 05 '17 at 12:09
  • I have already tried it , not works. –  Apr 05 '17 at 12:13
  • Your image doesn't show... did you try adding `po $arg1` as the action? – DonMag Apr 05 '17 at 12:17
  • @DonMag friend i have tried it too, it is printing error log only. –  Apr 05 '17 at 12:28
  • Can you show very brief code that you are using? – DonMag Apr 05 '17 at 12:32
  • @DonMag, i know what is the my crash issue, my question is not for why i am getting crash. Please read question one more time. –  Apr 05 '17 at 12:35
  • Right... I'm asking if you have brief code that causes the crash, so someone else (such as myself) could run a couple tests - *using the exact same code* - to see if we can resolve the issue. – DonMag Apr 05 '17 at 12:37
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/139974/discussion-between-yummy-and-donmag). –  Apr 05 '17 at 12:37

1 Answers1

1

In Xcode 8.3 after adding only "Exception Breakpoint" the breakpoint stops where the exception occursSee screenshot

Shehroz
  • 171
  • 3
  • 11