为什么LLDB无法打印view.bounds? [英] Why can't LLDB print view.bounds?

查看:90
本文介绍了为什么LLDB无法打印view.bounds?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这样的事情在调试时让我发疯:

Things like this drive me crazy when debugging:

(lldb) p self.bounds
error: unsupported expression with unknown type
error: unsupported expression with unknown type
error: 2 errors parsing expression
(lldb) p (CGRect)self.bounds
error: unsupported expression with unknown type
error: unsupported expression with unknown type
error: C-style cast from '<unknown type>' to 'CGRect' is not allowed
error: 3 errors parsing expression
(lldb) p [self bounds]
error: 'bounds' has unknown return type; cast the call to its declared return type
error: 1 errors parsing expression
(lldb) p (CGRect)[self bounds]
(CGRect) $1 = origin=(x=0, y=0) size=(width=320, height=238)
(lldb) You suck!
error: 'You' is not a valid command.
(lldb) …

为什么前3次尝试失败?有没有更简单的打印self.bounds的方法?谢谢.

Why did the first 3 attempts fail? Is there any simpler way to print self.bounds? Thanks.

推荐答案

从Xcode 6.3开始,我们有了更好的解决方案.简而言之,您需要为LLDB导入UIKit来了解以下类型: expr @import UIKit.查看这篇文章以了解一些技巧.使您的生活更加轻松.

Starting from Xcode 6.3, we have a better solution. In short, you need to import UIKit for LLDB to know about these types: expr @import UIKit. Check out this article to learn some tricks to make your life even easier.

这篇关于为什么LLDB无法打印view.bounds?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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