How to find instance by hex in XCode console?

后端 未结 2 694
刺人心
刺人心 2020-12-31 04:58

When I bring up console after my iPhone app crashes, it often says \"unrecognized selector sent to instance 0x blah blah blah.\" How can I find out what variable this is?

2条回答
  •  清酒与你
    2020-12-31 05:20

    It's very helpful to create an Exception breakpoint, and with Xcode 7.3, it's never been easier. This will help you find the line of code causing an exception.

    1. add breakpoint on the line where the app crashes
    2. click the breakpoint in the Project Navigator menu
    3. find the breakpoint you just created and select it
    4. click the "+" at the bottom left
    5. Select "Add Exception Breakpoint"

    Run your code...whenever you get a "unrecognized selector sent to instance 0x blah blah blah," the debugger will stop on the line that's causing the problem.

提交回复
热议问题