How do I add a Watch or Inspect in Xcode?

后端 未结 2 388
自闭症患者
自闭症患者 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条回答
  •  Happy的楠姐
    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:

提交回复
热议问题