views:

96

answers:

1

I have a UIIMageView and want to output values such as:

  • myobject.center.y
  • myobject.frame

Basically, position and size information. I'm using both "po" in the console and breakpoint actions with @@ but neither works. I always end up with an error such as "There is no member named center". How do I output these values in both the debugger console and through breakpoint actions?

Also, is it possible to have the frame outline draw itself so I can see it in the view?

+1  A: 

In my experience, GDB doesn't work with the dot syntax for properties. You need to use [myobject center].y or [myobject frame] instead. Also, since neither CGFloat nor CGRect are objects you need to use "p" instead of "po".

Martin Gordon
I tried several different techniques but none seem to work: ...p (float) [myboject center].x... and ...print (float) fabs ([myboject frame].x)... and ...p [myboject center].x... All give the error: Unable to call function "objc_msgSend" at 0x300c8c04: no return type information available.To call this function anyway, you can cast the return type explicitly (e.g. 'print (float) fabs (3.0)')
4thSpace
Try "p (CGPoint)[myobject center]" and "p (float)((CGRect)[myobject center]).y"
Martin Gordon
Thanks. The first worked but the second didn't. It gives the error "No symbol "CGRect" in current context."
4thSpace