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

前端 未结 7 474
庸人自扰
庸人自扰 2021-01-30 17:14

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:

7条回答
  •  青春惊慌失措
    2021-01-30 17:44

    Add a pch file , add these lines of code to the file:

    #ifndef PrefixHeader_pch
    #define PrefixHeader_pch
    
    #ifdef __OBJC__
    #import 
    #endif  
    
    #endif /* PrefixHeader_pch */    
    

    Next, link the pch file to your project:

    Run the app again, then you should be able to use the dot notation in lldb console:

    (lldb) po self.view.bounds    
    

    For how to add a pch file , see the answer here PCH File in Xcode 6

提交回复
热议问题