How do you watch or evaluate an expression in xcode like visual studio's immediate window?

前端 未结 6 896
滥情空心
滥情空心 2021-02-05 06:08

In MS visual studio we just right click add watch.

How does one do this in Xcode?

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 06:38

    Gabe's answer is almost there but missing one crucial detail: Select Debugger Output . By default the bottom option is set to Target Output, so the po command doesn't show you anything.

    Here is a sandwich app from a tutorial I'm debugging:

    eval expression screenshot in xcode

    Being an xcode newbie and coming from a MS Visual Studio Background, I wanted exactly what the OP was looking for. While playing around from reading Gabe's answer I selected Debugger Output and got what I wanted.

提交回复
热议问题