Xcode has the wrong debug values while paused in the debugger

纵饮孤独 提交于 2021-01-27 10:38:09

问题


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

See this:

Screenshot of XCode issue

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


回答1:


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



来源:https://stackoverflow.com/questions/16203546/xcode-has-the-wrong-debug-values-while-paused-in-the-debugger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!