How to locate where the bug is for "unrecognized selector sent to instance"?

debugging, ios, objective-c, xcode

Solution

The easiest way is to add an Exception Breakpoint.

Go to the back point pane and click op de `+` in the left corner. In popup select `Add Exception Breakpoint`.

Just click `Done` in the popup, no you have a breakpoint on any exception thrown by the debugger which will allow you to locate the line where the error is thrown.

Problem

Sometimes my app crashes because of this error log: ``` -[NSNull floatValue]: unrecognized selector sent to instance 0x3befd090 ``` I didn't call any "`floatValue`", so how can I locate which exact line crash the app? To reproduce the crash require some specific data from the website I have no control over, so any ideas to fix this? Thanks.

Original source