as in the title is there a way in Xcode to Add Watch or Inspect a code segment in Xcode
在标题中有一种方法可以在Xcode中添加监视或检查Xcode中的代码段
for example how can I see the result of [myObject aMethod] with actually stepping over or Stepping in.
例如,我如何看到[myObject aMethod]的结果,实际上是踩到或踩到。
2 个解决方案
#1
14
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]
).
在调试器控制台中,如果您在断点处停止,则可以键入po [myObject aMethod]以查看返回值(如果它不是id类型返回值,请使用p([返回类型])[myObject aMethod])。
You can also set a breakpoint action to print something out without pausing, just right click to edit the breakpoint:
您还可以设置断点操作以打印出不停顿的内容,只需右键单击即可编辑断点:
#2
#1
14
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]
).
在调试器控制台中,如果您在断点处停止,则可以键入po [myObject aMethod]以查看返回值(如果它不是id类型返回值,请使用p([返回类型])[myObject aMethod])。
You can also set a breakpoint action to print something out without pausing, just right click to edit the breakpoint:
您还可以设置断点操作以打印出不停顿的内容,只需右键单击即可编辑断点: