Xcode 4 中的表达式窗口在哪里?

发布于 2024-10-31 21:18:03 字数 121 浏览 4 评论 0原文

如何在 Xcode 4 中添加要观看的表达式?

这应该是非常明显的,但事实并非如此。它似乎不在任何菜单中,也不能在上下文单击中使用。如果我可以突出显示变量或表达式,然后“添加到监视”或“添加表达式”,那就太好了。

How can I add an expression to watch in Xcode 4?

This should be very obvious, but it is not. It does not seem to be down any menu or available on a contextual click. It would be nice if I could highlight a variable or expression and then "Add to watch" or "Add expression".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

眉黛浅 2024-11-07 21:18:03

我不知道有一个选项可以直接从 Xcode 4 的代码窗口创建监视表达式。如果代码窗口中有某些内容您想要添加表达式监视,我认为您必须将该代码复制到剪贴板。

然后在调试时,确保显示调试区域。它是 Xcode 中底部中心视图。您可以通过单击调试视图中相应的视图图标来显示此区域。

Show Xcode 4's Debug Area

然后,在调试区域的左下角,您将看到监视列表。您可以通过右键单击并选择“添加表达式”将表达式添加到此列表:

右键单击添加表达式http://blog.roughfalls.com/non-wp/img/xcode4_addexpression.png

选择此选项后,会出现一个对话框。您可以将复制到剪贴板的表达式粘贴到此对话框中,然后单击“添加”。监视表达式在列表中用左侧的小“E”图标表示。

I don't know that there is an option to create a watch expression directly from Xcode 4's code window. If there's something in the code window you'll want to add an expression watch for, I think you'll have to copy that code to the clipboard.

Then while debugging, make sure the debug area is being shown. It is the bottom center view in Xcode. You can show this area by clicking the appropriate view icon from the debug view.

Show Xcode 4's Debug Area

Then in the lower left of the debug area, you have your watch list. You can add an expression to this list by right-clicking and selecting Add Expression:

Right-click to add an expression http://blog.roughfalls.com/non-wp/img/xcode4_addexpression.png

After you select this option, a dialog appears. You can paste the expression that you copied to the clipboard into this dialog, and click "Add." Watch expressions are denoted in the list with a small "E" icon to their left.

飘然心甜 2024-11-07 21:18:03

请注意:我遇到了表达式问题,它们没有得到评估(Xcode 4.3.2 调试区域中的表达式未评估)。

为了使其正常工作,我还必须包含表达式的结果类型(例如 (NSString *)[tag name])。

在此处输入图像描述

Just a note: I had a problem with expressions that they didn't get evaluated (Expression in Xcode 4.3.2 Debug area not evaluated).

To make it working, I had to include also the result type of the expression (e.g. (NSString *)[tag name]).

enter image description here

戴着白色围巾的女孩 2024-11-07 21:18:03

接受的答案中的图像链接已损坏,因此这里有一个图像来补充它。

输入图片此处描述

右键单击​​调试区域中的监视列表,然后选择“添加表达式...”

The image link is broken in the accepted answer, so here is an image to supplement it.

enter image description here

Right click the watch list in the debug area and choose "Add Expression..."

樱娆 2024-11-07 21:18:03

对于那些寻求快速使用“添加表达式”的人:
右键单击调试区域中的变量视图。然后选择添加表达式

在此处输入图像描述

写入您的 instanceNameinstanceName.propertyName,然后按 Enter 键。就是这么简单。

输入图片此处描述

For those looking for a Swift usage of Add Expression:
Right click the Variables View in Debug Area. Then choose the Add Expression

enter image description here

Write your instanceName or instanceName.propertyName and press enter. It is that easy.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文