iPhone - 可以在Xcode调试器中检查UIView的框架吗? [英] iPhone -- is it possible to inspect the frame of a UIView in the Xcode debugger?

查看:218
本文介绍了iPhone - 可以在Xcode调试器中检查UIView的框架吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当调试器在断点处停止时,我找不到任何UIViews的框架。



可以这样做吗? / p>

编辑:由于缺乏回应而开始赏金。要清楚,我正在寻找的是一种查看框架而不添加额外调试代码的方法。



另外,如果答案是不可以要做到这一点,赏金会去最好的解释为什么你可以看到一些班级的成员,而不是别人。

解决方案

是的, 你能行的。调试时,在变量检查器中找到感兴趣的UIView。按住Control键并单击,然后选择打印说明到控制台。例如,我在UIViewController的_view ivar上这样做,并在控制台中显示以下内容:


打印描述_view:

< UIView:0x25b460; frame =(0 0; 320 480);自动调整= W + H; layer =< CALayer:0x26b740 >>



When the debugger is stopped at a breakpoint, I can't find the frame of any of my UIViews in there.

Is it possible to do this?

EDIT: starting a bounty due to the lack of response. Just to be clear, what I am looking for is a way to see the frame without adding in extra debugging code.

Also, if the answer is "no you can't do it", bounty will go to the best explanation of why you can see some class members but not others.

解决方案

Yes, you can do it. While debugging, find the UIView of interest in the variable inspector. Control-click on it and select "Print Description to Console". For example, I did this on the _view ivar of a UIViewController and the following appeared in the console:

Printing description of _view:
<UIView: 0x25b460; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x26b740>>

这篇关于iPhone - 可以在Xcode调试器中检查UIView的框架吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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