有没有人看到这个?在另一个运行中,变量实际上在变量视图中显示为NSDate !!!
解决方案断点实际上在线出现在;该行尚未执行。因此,您在这个变量上看起来太早了。在 之后之前过去初始化的行之前,它没有意义的价值。您仍然在该行之前,所以它的值是随机垃圾。
I'm using Xcode 6.3.1. I'm trying to track a weird issue in an app and now I'm seeing that local variables seem to be incorrectly initialised. When I hit a breakpoint at the line where a local variable is defined and initialised at the same time, it is actually shown as an existing local variable, but with a corrupt value:
Has anyone else seen this? In another run the variable was actually showing in the variable view as being an NSDate !!!
解决方案A breakpoint is actually before the line it appears on; that line has not yet executed. You are thus looking too soon at this variable. It has no meaningful value until after you step past the line where it is initialized. You are still before that line so its value is random garbage.
更多推荐
模拟时调试器下的堆栈/堆栈损坏?
发布评论