iPhone -- is it possible to inspect the frame of a UIView in the Xcode debugger?

Viewed 21895

When the debugger is stopped at a breakpoint, I can't find the frame of any of my UIViews in there.

Is it possible to do this?

EDIT: starting a bounty due to the lack of response. Just to be clear, what I am looking for is a way to see the frame without adding in extra debugging code.

Also, if the answer is "no you can't do it", bounty will go to the best explanation of why you can see some class members but not others.

12 Answers

Interestingly, using the getter method to return the view's frame works:

print (CGRect)[view frame]

This gives the expected result:

(CGRect) $2 = origin=(x=0, y=20) size=(width=320, height=48)

But if you try to use dot notation, which I hear so often referred to as being provided simply for 'syntactic sugar':

print (CGRect)view.frame

You get the following error:

error: C-style cast from '<unknown type>' to 'CGRect' is not allowed
Related