我如何看Xcode的调试器中的一个对象? [英] How do I look at an object in Xcode's debugger?

查看:134
本文介绍了我如何看Xcode的调试器中的一个对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Xcode和GDB调试的简单问题。



我经常遇到错误:

 无法识别的选择器发送到实例0x1081ad0 

加载到GDB中有没有一个简单的方法来检查来自GDB的内存中的实例?

解决方案

po 0x1081ad0



po =打印对象。
您甚至可以调用方法,如



po [myArray objectAtIndex:0]



请注意,它仅适用于对象,因此



po 1



会使您的程序崩溃。


I have a simple question about debugging on Xcode and GDB.

I often run into an error:

unrecognized selector sent to instance 0x1081ad0

which makes the program load into GDB. Is there an easy way to examine what instance is located in that memory from GDB?

解决方案

po 0x1081ad0

po = Print Object. You can even call methods, like

po [myArray objectAtIndex:0]

Note that it only works on objects, so

po 1

will crash your program.

这篇关于我如何看Xcode的调试器中的一个对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆