I am trying to understand how to accomplish some basic debugging stuff with gdb
I want to check the length of this control (UILabel)
if I type the following in the console I get nothing, what’s the proper way to do it?
(gdb) po self.mylabel.frame.size.width
There is no member named frame.
or if I try without self:
(gdb) po mylabel.frame.size.width
There is no member named frame.
There must be a way, not obvious for sure. Visual Studio has such a fantastic debugger helpers in tracking the values of objects and co…
If you just type
po myLabel, it will output the frame details. Of you can also usepo NSStringFromCGRect(myLabel.frame). (See this link for some useful function along the lines of NSStringFromCGRect.)Alternatively, width is a float, so you can use
p (float) myLabel.frame.size.width.In general,
pois used to print the value of objects, whilepis used for basic types.