if (labelEast.center.x > (east_oldPosition.x + 50) ) NSLog(@"Time to switch to prevIoUs exercise !"); else if (labelEast.center.x < (east_oldPosition.x - 50) ) NSLog(@"Time to switch to next exercise !");
设置断点后,我只是想看看labelEast.center.x(labelEast是一个UILabel对象).由于我在Xcode 4菜单中找不到监视项目,因此我尝试使用gdb.我习惯用po(打印对象)打印变量/对象值.但是现在,我无法显示labelEast中心属性,因为它是从母类继承的.
(gdb) po labelEast.center
There is no member named center.
因此我有两个问题:
>如何在没有gdb的情况下以图形方式观看这样的属性(就像在Visual Studio中一样)?
>如何用gdb做同样的事情?
非常感谢,
弗朗茨
不幸的是,我尝试了但得到了这个:
po [labelSouth center]
Program received signal EXC_BAD_ACCESS,Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x1a000356 0x343c7d06 in
objc_msgSend_stret () The program being debugged was signaled while in
a function called from GDB. GDB remains in the frame where the signal
was received. To change this behavior use “set unwindonsignal on”
Evaluation of the expression containing the function (objc_msgSend)
will be abandoned.
当我尝试:
(gdb) print labelSouth.center
There is no member named center.
我真的怀疑UILabel没有中心物业.但我怎么能运行代码???
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。