问题
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:
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