0

I have enabled exception breakpoints in xcode but whenever I encounter an exception it never takes me to the line that caused the exception to be thrown. All I get is this:

@autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); thread 1: SIGABRT
    }

And the console is outputting the following:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

I am simply trying to get xcode to show me where I am trying to insert a nil object into an array but it isn't cooperating. Am I doing something wrong here?

I can't post an image of the error since I do not have 10 reputation.

Noah
  • 1,857
  • 15
  • 19
  • 1
    possible duplicate of [Xcode doesn't show the line that causes a crash](http://stackoverflow.com/questions/7703052/xcode-doesnt-show-the-line-that-causes-a-crash) – Noah May 19 '14 at 15:24
  • pretty obvious. Tells you the error .. Where ever you are adding an object to an array. That object is nil. This is causing the raised exception. – CW0007007 May 19 '14 at 15:31
  • You need to add an [exception breakpoint](https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html) – toasted_flakes May 19 '14 at 15:53
  • @grasGendarme I did do that, but I want Xcode to actually highlight the line of code where the exception is being thrown, not just stay inside of main.m and tell me that the thread threw an exception. Is there any way to do this? – RomeTizzle May 19 '14 at 16:01
  • On my machine, when the exception breakpoint is hit, Xcode switch to the line causing the exception. Is it set to "on throw" ? – toasted_flakes May 19 '14 at 16:18
  • See http://raywenderlich.com/10209/my-app-crashed-now-what-part-1 – rmaddy May 19 '14 at 17:35

0 Answers0