Why can't LLDB print view.bounds?

后端 未结 8 2088
离开以前
离开以前 2020-12-23 16:02

Things like this drive me crazy when debugging:

(lldb) p self.bounds
error: unsupported expression with unknown type
error: unsupported expression with unkno         


        
8条回答
  •  时光取名叫无心
    2020-12-23 16:53

    I tried @an0's answer expr @import UIKit, but it didn't work.

    Then I added a pch file, and add these lines of code in the file:

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

    Next, link the pch file to my project:

    Run the app again, then I can 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

提交回复
热议问题