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 th
po [[[[UIApplication sharedApplication]windows] objectAtIndex:0] recursiveDescription]
will print out the entire view heirachy but only seems to work in gdb and not llvm
In Xcode, go to the console and type:
po viewName
If execution is inside code for the view, you can just:
po self
This will output some view details, like this:
<UIView: 0x9cca0f0; frame = (0 0; 320 480); layer = <CALayer: 0x9ccabe0>>
Found an answer for lldb. For example, this works
(lldb) print (CGRect)[((UIView *)[[[self backIV] subviews] objectAtIndex:1]) frame]
Re-formatting @EPage_Ed's answer because the original was hard-coded for his specific case:
At the (lldb) prompt, type:
print (CGRect)[view frame]
Or, for the bounds:
print (CGRect)[view bounds]
I prefer the short form for print i.e. 'p' to print the frame in lldb. For e.g.
p (CGRect)[view frame]
Sometimes they are just out of scope by the time you get there.
Print them to the console:
NSLog('Frame: %d, %d, %d, %d', frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);