Kevin DiTraglia
Kevin DiTraglia

Reputation: 26058

How to evaluate a statement in XCode debugger

So every other IDE I have ever used, if there is some statement in the code with a break point set, there is a way to evaluate that statement to see what it is returning, ie immediate windows in visual studio, or using watch menu. Is there anything somewhat equivalent in XCode, or some way to evaluate a statement within a section of code?

ex:

if (CGRectContainsPoint([FGO BoundingBox], touchLocation))

Is returning false, so I'd like to see what [FGO BoundingBox] is evaluating to, but I can't seem to figure anything out short of changing the code to store it in an intermediate variable. Assuming I have a break point on this line in XCode what is the easiest way to see what this statement will return?

Upvotes: 1

Views: 1083

Answers (2)

Michael Dautermann
Michael Dautermann

Reputation: 89509

Break on that line, then step in to the "BoundingBox" function and step to the end of it (or where it returns something) and you should see what it's returning.

Upvotes: 0

rjowens
rjowens

Reputation: 1077

You can try:

po [FGO BoundingBox]

or

po NSStringFromCGRect([FGO BoundingBox])

also check out

help expression

in the debugger.

Upvotes: 2

Related Questions