How do I add a Watch or Inspect in Xcode?

后端 未结 2 365
自闭症患者
自闭症患者 2021-02-05 17:32

as in the title is there a way in Xcode to Add Watch or Inspect a code segment in Xcode

for example how can I see the result of [myObject aMethod] with actually stepping

相关标签:
2条回答
  • 2021-02-05 18:11

    In the debugger console, if you stop at a breakpoint you can type po [myObject aMethod] to see the return value (if it's not an id type return value, use p ([return type here])[myObject aMethod]).

    You can also set a breakpoint action to print something out without pausing, just right click to edit the breakpoint:

    0 讨论(0)
  • 2021-02-05 18:23

    To actually see the value change while you step through, you can right click the watch list of the debug area and choose "Add Expression..."

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