Xcode在调试器中暂停时具有错误的调试值 [英] Xcode has the wrong debug values while paused in the debugger

查看:72
本文介绍了Xcode在调试器中暂停时具有错误的调试值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode中遇到一个奇怪的问题.在此NSMutableArray对象上使用insertObject:withIndex:之后,即使对其他局部变量显示了正确的值,调试窗口也会为数组显示错误的值,并且此声明距离传递仅一步之遥.

I am having a strange problem in Xcode. After I use insertObject:withIndex: on this NSMutableArray object, the debug window shows the wrong value for the array even though the correct values are show for the other locals and this assertion is one step away from passing.

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

I noticed this was happening in the application I was developing, because it seemed the method on that object was not working correctly. I wrote the unit test to demonstrate the issue I was having, and expecting it to fail, but instead it passes. This is the unit test I used:

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);

看到这个:

我需要怎么做才能使调试器正确显示此信息,您是否认为它配置错误?

What do I need to do to have the debugger show this correctly, do you think it is misconfigured?

推荐答案

我可以确认此错误,看起来调试器UI并未更新,但实际数据还可以(尝试从上下文菜单中打印该数组的值)).我建议您将错误提交给radar://13755626

I can confirm this bug, looks like debugger UI isn't updating, but the actual data is fine (try to print the value of that array from context menu). I suggest you submit a bug to radar://13755626

这篇关于Xcode在调试器中暂停时具有错误的调试值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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