gpt4 book ai didi

ios - 错误 : property 'frame' not found on object of type 'UIView *'

转载 作者:IT王子 更新时间:2023-10-29 07:46:09 29 4
gpt4 key购买 nike

我正在调试我的代码并尝试使用此计算出 View 的大小:

p view.frame.size.height

但是我收到了这个错误:

错误:在“UIView *”类型的对象上找不到属性“frame”错误:1 错误解析表达式

你们中有人知道为什么或如何调试我的 View 大小吗?

最佳答案

如果你讨厌每次都进行类型转换,你可以试试这个:

(lldb) expr @import UIKit
(lldb) po self.view.bounds

由于 Xcode 7.2 现已可用,我认为我们应该更新答案。
我在这里找到答案,Why can't LLDB print view.bounds?

关于ios - 错误 : property 'frame' not found on object of type 'UIView *' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16926239/

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