Float variables assigned from the line above

I have an iOS application that does things that make no sense to me. I have several float variables defined in my interface that are not assigned correctly.

kettleVolume = 30; lbsGrain = 5; mashIn = 65; grainTemp = 20; 

When I do this on the debugger, I see the following values ​​very clearly:

 kettleVolume float 1.09038e-33; lbsGrain float 30 mashIn float 5 grainTemp float 65 

Somehow they get the values ​​from the string above them? What am I doing wrong?

+2
source share
1 answer

There are many reports that when checking ivars from LLDB they seem to be wrong (I had the same problem many times). In particular, they seem to be shifted. However, this only seems to be a mistake in the implementation of the Xcode inspector. If you want to be sure of 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

0
source

All Articles