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 _yourivarin the debugger console, useGDBorNSLogthem. There is also a similar question here: GDB Vs LLDB debuggers