【问题标题】:Xcode has the wrong debug values while paused in the debuggerXcode 在调试器中暂停时有错误的调试值
【发布时间】:2013-04-24 22:49:25
【问题描述】:

我在 Xcode 中遇到了一个奇怪的问题。在我对这个 NSMutableArray 对象使用 insertObject:withIndex: 之后,调试窗口会显示数组的错误值,即使其他本地变量显示了正确的值,而且这个断言距离传递还有一步之遥。

我注意到我正在开发的应用程序中发生了这种情况,因为该对象上的方法似乎无法正常工作。我编写了单元测试来证明我遇到的问题,并期望它失败,但它通过了。这是我使用的单元测试:

NSMUtableArray *targetArray = [[NSMutableArray alloc] initWithObject:@"Initial 0 object", nil];
NSString *new0object = @"new 0 object";
[targetArray insertObject:new0object atIndex:0];
NSString *current0object = [targetArray objectAtIndex:0];
STAssertTrue([current0object isEqualToString:new0object], nil);

看这个:

我需要做什么才能让调试器正确显示,你认为它配置错误吗?

【问题讨论】:

  • 浪费了整个晚上...整个上午,一直在思考....WTF 正在进行中。事实证明...xcode 向我显示了错误的值

标签: objective-c xcode debugging xcode4.6


【解决方案1】:

我可以确认这个错误,看起来调试器 UI 没有更新,但实际数据很好(尝试从上下文菜单打印该数组的值)。我建议你向radar提交一个错误://13755626

【讨论】:

    猜你喜欢
    • 2012-10-01
    • 2010-11-20
    • 2018-05-12
    • 2020-10-31
    • 1970-01-01
    • 2012-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多