Why can't LLDB print view.bounds?

后端 未结 8 2087
离开以前
离开以前 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 17:01

    LLDB does not support dot notation for message sending when using p and that's why

    p self.bounds
    

    doesn't work, but

    p [self bounds]
    

    does.

    (It actually supports it for objects when you use po, though)

    Also, LLDB doesn't have type information of non-objects available at runtime, so you need to explicitly provide a type by casting the return value.

    0 讨论(0)
  • 2020-12-23 17:02

    Try with following expression,

    p self.view.bounds.size.width
    

    or use,

    po self.view
    

    p - Print is only uses to print normal/simple values while, po - Print Object works same as NSLog to print value of an object

    0 讨论(0)
提交回复
热议问题