Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: property 'frame' not found on object of type 'UIView *'

Tags:

ios

view

lldb

I'm debugging my code and trying to figure out the size of the view using this:

p view.frame.size.height 

but I'm getting this error:

error: property 'frame' not found on object of type 'UIView *' error: 1 errors parsing expression

any of you knows why or how can I debug the size of my view?

like image 336
HelenaM Avatar asked Jun 04 '13 19:06

HelenaM


2 Answers

If you hate typecasting every time, you can try this:

(lldb) expr @import UIKit (lldb) po self.view.bounds 

Since Xcode 7.2 is now available, I think we should update the answer.
I find the answer here, Why can't LLDB print view.bounds?

like image 90
Chris Yim Avatar answered Sep 24 '22 16:09

Chris Yim


Try this

p (CGRect)[view frame] 

Alternative to get the frame of the view:

po view 
like image 32
Sonny Saluja Avatar answered Sep 25 '22 16:09

Sonny Saluja