Search code examples
objective-cdebuggingsparrow-framework

How do you see values when debugging in Xcode?


I'm trying to see what the value of myImage.height is in the debug mode in Xcode, I've got a breakpoint on this line...

float s=myImage.height/cos(30*M_PI/180)/2;

It all runs fine and get's to that line, in the debug panel I can see myImage (my Image is a Sparrow framework SPImage object) but I can't see any values for any of the class vars.

This is literally the first time I've used a break point/debug panel in xcode so I'm probably just not doing something right.

I also tried

NSLog(@"myImage height: %f",myImage.height);

But I can't see that being outputted in the output panel either.

I'm coming from a AS3 background, where you would see...

myImage.height along with it's value to the right in the debug panel in Flash, so I'm looking for the same thing in Xcode. Do I have to run it in a different mode or is there another panel to open or something?


Solution

  • In the console area, you can show 2 distinct "parts", one is the variables in scope, and the other is the actual output console. In the stack area, you can see all variables in scope.

    You can also hover your mouse over any variable in code, then click on the little disclosuer arrow and select "print description" to have it plop it into the console. (The console is also where NSLog stuff goes).

    Check out this picture:

    Xcode debugging

    And then this one: enter image description here

    Note you can also "print description" from the variable area:

    print description from variables area

    edit here's more detail on the hover-access to the value: Click on the variable name, then move the mouse to the right, and there should pop up a yellow bar with info about the instance. This is is different from the little blue arrow, which is available even when not debugging.

    hover access to runtime value enter image description here