lldb无法使用“错误”来打印变量值:对“id”的引用是不明确的“ [英] lldb fails to print variable values with "error: reference to 'id' is ambiguous"

查看:349
本文介绍了lldb无法使用“错误”来打印变量值:对“id”的引用是不明确的“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我更新到xcode 4.3并让它将我的调试器切换到lldb,因此任何打印成员变量的请求都会失败,并显示以下错误消息:

Since I updated to xcode 4.3 and let it switch my debugger over to lldb, any request to print a member variable fails with this error message:

(lldb) print request
error: error: reference to 'id' is ambiguous
note: candidate found by name lookup is 'id'
note: candidate found by name lookup is 'id'
error: 1 errors parsing expression

'self'没问题:

(lldb) print self
(LoginViewController *) $6 = 0x1cd54d50

打印成员变量的其他形式也会失败:

And other forms of printing the member variable also fail:

(lldb) print self.request
error: property 'request' not found on object of type 'LoginViewController *'; did you mean to access ivar 'request'?
error: 1 errors parsing expression
(lldb) print self->request
error: error: reference to 'id' is ambiguous
note: candidate found by name lookup is 'id'
note: candidate found by name lookup is 'id'
error: 1 errors parsing expression

其他一切似乎都运转良好。 Xcode的变量窗口可以正确检索值。我尝试了一个干净的构建并删除了〜/ Library / Developer / Xcode / DerivedData /。谷歌搜索没有透露任何其他相同问题的实例。

Everything else otherwise seems to be working fine. Xcode's variable window can correctly retrieve the value. I've tried a clean build and deleting ~/Library/Developer/Xcode/DerivedData/. Googling hasn't revealed any other instances of the same problem.

我在Apple的开发论坛上发现了一个线程但没有解决方案:

I found one thread on Apple's dev forum but no solution:

https://devforums.apple.com/message/623694

我已将此报告给Apple作为错误ID#11029004。

I've reported this to Apple as Bug ID# 11029004.

推荐答案

我找到了一个解决方法:

I found one workaround:

使用产品菜单下的编辑方案,在左侧栏中选择运行,信息标签,然后更改调试器到gdb(这不适用于不再有gdb的xcode 5)。

Use 'Edit scheme' under the 'Product' menu, select 'Run' in the left bar, the 'Info' tab, and change the Debugger to gdb (this does not apply to xcode 5, which no longer has gdb).

显然Apple认为他们已经修复了xcode 4.3.1中的这个错误,但是它仍然发生。我提交了一些他们要求的额外调试信息,所以我希望它能在xcode的下一个版本中修复。它仍然在4.3.2中失败。有关Apple的更新,请参见 https://devforums.apple.com/message/623694

Apparently Apple thought they'd fixed this bug in xcode 4.3.1, but it still happens. I submitted some extra debug information they requested, so I'm hoping it'll be fixed for the next release of xcode. It's still failing in 4.3.2. See https://devforums.apple.com/message/623694 for an update from Apple.

更新

我尝试了各种情况,我遇到了麻烦,它们似乎在Xcode 4.4.1中与lldb一起工作正常 - 因此如果你遇到这个问题,我强烈建议升级。

I've tried various cases I was having trouble with, and they all seem to be working fine with lldb in Xcode 4.4.1 - hence I highly recommend upgrading if you're having this problem.

这篇关于lldb无法使用“错误”来打印变量值:对“id”的引用是不明确的“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆