gpt4 book ai didi

ios - Swift 3 和 lldb : Print frame of UIView, 给定十六进制地址

转载 作者:搜寻专家 更新时间:2023-10-31 22:05:35 31 4
gpt4 key购买 nike

调试 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/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com