浮动变量从上面的行中分配值 [英] Float variables assigned value from line above
问题描述
kettleVolume = 30;
lbsGrain = 5;
mashIn = 65;
grainTemp = 20;
当我在调试器上进行这个操作时,我很清楚地看到下面的值被赋值 - p>
kettleVolume float 1.09038e-33;
lbsGrain float 30
mashIn float 5
grainTemp float 65
不知何故,他们正在从上面的线获得值?什么是我做错了?
有很多报告,当从LLDB检查ivars他们似乎是错误的(我有同样的问题多次)。更具体地说,他们似乎正在转移。这就是说,它似乎只是XCode检查员执行过程中的一个错误。如果你想在调试器控制台中确定你的值,可以使用 GDB
或 NSLog
它们。还有一个类似的问题在这里: GDB VS LLDB调试器
I have an iOS App that is doing things that don't quite make sense to me. I have several float variables defined in my interface that are being assigned incorrectly.
kettleVolume = 30;
lbsGrain = 5;
mashIn = 65;
grainTemp = 20;
When I step through this on the debugger, I very clearly see the following values being assigned-
kettleVolume float 1.09038e-33;
lbsGrain float 30
mashIn float 5
grainTemp float 65
Somehow, they are getting the values from the line above them? What am I doing incorrectly?
There are numerous reports that when inspecting ivars from LLDB they seem wrong (myself had the same problem many times). More specifically they seem to be shifted. That said, it only seems to be a bug in the implementation of XCode's inspector. If you want to be sure about the values you can either po _yourivar
in the debugger console, use GDB
or NSLog
them. There is also a similar question here: GDB Vs LLDB debuggers
这篇关于浮动变量从上面的行中分配值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!