如何在XCode控制台中按十六进制查找实例?
当我在 iPhone 应用程序崩溃后打开控制台时,它经常显示“无法识别的选择器已发送到实例 0x 等等”。我怎样才能知道这是什么变量?调试器中有办法吗?有可能吗?谢谢。
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? Is there a way in the debugger? Is it even possible? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 gdb 中,您可以键入
打印该地址处对象的
-description
。但这些信息很少有用。您应该首先检查异常的回溯,这可以找到导致问题的代码行。In gdb you could type
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.创建异常断点非常有帮助,在 Xcode 7.3 中,这从未如此简单。这将帮助您找到导致异常的代码行。
运行您的代码...每当您收到“无法识别的选择器发送到实例 0x blah blah blah”时,调试器将停止在导致问题的行上。
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.
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.