Reputation: 45138
I have done some changes to my project and now I am getting above message when running the app and don't how how to debug it.
I have read here that I have to put a break point in -[NSCFDictionary setObject:forKey:]
and set a condition as well.
But, how do I set the condition they mentioned? (Stop only when value is nil) I am on Xcode4 and only get this window when trying to set a breakpoint.
Currently it stops at every -[NSCFDictionary setObject:forKey:]
which is not very helpful since it will stop even in correct calls and Apple's internal calls as well (too many!)
Upvotes: 4
Views: 5119
Reputation: 104708
if you have reduced it to a call site, you can simply write:
assert(object);
[dictionary setObject:object forKey:key];
Upvotes: 0
Reputation: 61228
Remove that breakpoint and add an Exception breakpoint. This will stop on any exception (like attempting to insert nil into a dictionary). It's good practice to leave this breakpoint on for all debugging sessions, that way even intermittent exceptions (those hard-to-find problems) will be caught in the debugger the moment they happen.
To add an Exception breakpoint, click the Add (+) button at the bottom of the breakpoints list and click Add Exception Breakpoint. Leave it configured as-is.
Upvotes: 9