调试 iOS 目标、Swift 3、Xcode 8.2、lldb-360.1.68
我想打印一个 UIView 的 frame
,我在之前的断点处获取了它的地址。这是我最好的镜头,但结果令人失望:
(lldb) expr -l objc -O -- NSStringFromRect((CGRect)([(UIView*)0x7a241b30 frame]))
error: use of undeclared identifier 'CGRect'
谢谢!
最佳答案
如果你在快速调试器中,你可以使用 unsafeBitCast
将指针转换为类型。
po unsafeBitCast(0x7a241b30, to: UIView.self).frame
关于ios - Swift 3 和 lldb : Print frame of UIView, 给定十六进制地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41132516/