gpt4 book ai didi

ios - LLDB:查看 UIModalPresentationStyle 枚举的实际值

转载 作者:行者123 更新时间:2023-12-01 17:46:40 26 4
gpt4 key购买 nike

在为 UIViewController 实例的方法设置断点进行调试时,我决定检查 UIModalPresentationStyle 的值。

这是我得到的:

(lldb) po self.modalPresentationStyle
__C.UIModalPresentationStyle

我怎样才能得到变量的真实值,而不是它的类型?

我可以通过执行以下命令对其进行“逆向工程”:

(lldb) po self.modalPresentationStyle == .fullScreen
false

但是我怎样才能更快地达到预期的结果呢?

最佳答案

po 命令向对象询问其自身的描述。我不确定为什么 UIModalPresentationStyle 的快速对象描述只打印它的类型。这可能值得一个快速的错误。

但是如果你要求 lldb 计算表达式并为你返回它的值 - 而不是呈现该值的对象的描述 - 使用:

(lldb) p self.modalPresentationStyle
(UIModalPresentationStyle) $R0 = fullScreen

有时您会得到更有用的答案。

关于ios - LLDB:查看 UIModalPresentationStyle 枚举的实际值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52905334/

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