Xcode is throwing exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
However in debug mode it does not halt where the exception happened. It ends in
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
with message "SIGABRT". Stack trace only shows this "main".
Is there any way to figure out where in the code a nil object has been attempted to get inserted in an array?
In your project, go to the Breakpoint navigator, click the [+] button and Add Exception Breakpoint.... Click Exception > All, and Break > On Throw, click [Done].
With this setting in place, Xcode should break at the place in your project where the exception is thrown. You may need to walk down the stack for a frame or two to get to your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With