What's the difference between “p” and “po” in Xcode's LLDB debugger?

后端 未结 9 1456
无人及你
无人及你 2021-02-04 12:27

Example. I write the following string in my old project and a new, clear one:

UIInterfaceOrientation k = [UIApplication sharedApplication].statusBarOrientation;
         


        
9条回答
  •  感情败类
    2021-02-04 13:02

    • Use po, p, & v to print variables

      • po ends up compiling & executing twice, once to evaluate your expression and again to get the object description.

      • v doesn’t compile at all: can’t evaluate any expression but does allow property accessing and does recursive dynamic type resolution so each property is treated as the actual runtime type.


    For people who are interested in learning more : https://developer.apple.com/videos/play/wwdc2019/429/

    Add this as an answer for visibility, Also explains the functionality of each debugging commmand

提交回复
热议问题