gpt4 book ai didi

ios - 无法在控制台(调试区)使用 po 命令

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

突然间,我开始随机收到此消息(但非常频繁)

expression produced error: warning: /var/folders/53/0z4yfqt16tvbcn0z7f2385n80000gn/T/expr3-d271e2..swift:3:9: warning: initialization of variable '$__lldb_error_result' was never used; consider replacing with assignment to '_' or removing it var $__lldb_error_result = __lldb_tmp_error ~~~~^~~~~~~~~~~~~~~~~~~~ _

当我尝试在控制台中输入类似这样的内容时:

po myObject

所以,控制台只打印上面的消息,而不是它给我一些有用的东西......如何解决这个问题,是什么原因造成的?

最佳答案

lldb 在 Xcode 10.2 中发生了变化。 Apple 建议使用“p”或最近的“v”来查看变量的值。

来自 Xcode 10.2 Release Notes

The LLDB debugger has a new command alias, v, for the “frame variable” command to print variables in the current stack frame. Because it bypasses the expression evaluator, v can be a lot faster and should be preferred over p or po. (40066460)

LLDB Tutorial 中也有很好的信息在名为检查堆栈框架状态的部分中。

The frame variable command will also perform "object printing" operations on variables (currently we only support ObjC printing, using the object's "description" method. Turn this on by passing the -o flag to frame variable:

(lldb) frame variable -o self 
(SKTGraphicView *) self = 0x0000000100208b40
<SKTGraphicView: 0x100208b40>

关于ios - 无法在控制台(调试区)使用 po 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55515329/

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