2

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?

James
  • 215
  • 1
  • 3
  • 14
  • Are you debugging with LLDB? What about GDB? Did you try to `NSLog` them? – Alladinian Jun 09 '12 at 18:11
  • 3
    Also take a look at this: http://stackoverflow.com/questions/9707883/gdb-vs-lldb-debuggers – Alladinian Jun 09 '12 at 18:14
  • I am indeed using LLDB, and the link you posted mentions that ivars show up incorrectly when stepping through. Thanks for the answer! How can I give you credit? – James Jun 09 '12 at 18:42

1 Answers1

0

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

Community
  • 1
  • 1
Alladinian
  • 34,483
  • 6
  • 89
  • 91