Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS's LLDB's P command not printing frame variable

Tags:

xcode

ios

lldb

Lets say I want to do a

p uiTextFieldObj.frame

it will say error: property

'frame' not found on object of type 'UITextField *'

Is there any tricks I can do so I can get this to show?

like image 741
mskw Avatar asked Dec 11 '12 21:12

mskw


3 Answers

You can do this:

p (CGRect)[uiTextFieldObj frame]

As of Xcode 4.5.2, printing properties in lldb using the dot syntax only seems to work for properties of objects defined in your app, not for properties defined by framework classes.

like image 97
rob mayoff Avatar answered Nov 17 '22 10:11

rob mayoff


You can get it to print by doing [] notation instead of . notation:

Have you tried this?

print (CGRect)[textfieldObj frame]

Without the (CGRect) cast, it will most likely show an error saying that it doesn't know the return type. You can also just do:

po textfieldObj

which will show you the frame and some other information about the text field. the po debug command will call the objects -description method, which you can override to provide any information you like.

like image 33
GracelessROB Avatar answered Nov 17 '22 10:11

GracelessROB


See An @import-ant Change in Xcode

LLDB’s parser for Objective-C can now go through any module used in your app and determine the types used for all functions and methods it defines

e @import UIKit;
po uiTextFieldObj.frame
like image 3
onmyway133 Avatar answered Nov 17 '22 10:11

onmyway133