How to find instance by hex in XCode console?

后端 未结 2 671
刺人心
刺人心 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:08

    In gdb you could type

    po 0x12345678
    

    to print the -description of the object at that address. But this info is seldom useful. You should instead check the backtrace of the exception first, which can locate the line of code that causes the problem.

提交回复
热议问题