Xcode 4 - 分析问题不会在编辑器中显示

发布于 2024-11-05 14:47:09 字数 113 浏览 6 评论 0原文

在 Xcode 4.0.2 中运行分析会在问题导航器中显示问题。单击某个问题会使相应的文件出现在编辑器窗格中,但它没有显示代码中问题发生的位置,就像我在 Xcode 3.x 中习惯的那样。有谁知道如何开启此功能?

Running Analyze in Xcode 4.0.2 shows issues in the Issue Navigator. Clicking on an issue makes the appropriate file appear in the Editor pane, but nowhere does it show where in the code the issue occurs as I am used to from Xcode 3.x. Does anyone know how I can turn on this feature?

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

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

发布评论

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

评论(4

清旖 2024-11-12 14:47:09

一些提示:

首先,如果您正在寻找 Xcode 用箭头注释项目的视图,请记住,您可能需要在 Xcode 的问题导航器中展开顶级分析器结果,然后单击为了查看这些 - 请参阅屏幕截图。

屏幕截图 1:选择了顶级问题 - 无箭头

在此处输入图像描述

屏幕截图2:选择第二级问题 - 箭头!

在此处输入图像描述

第二个提示:如果那个东西不是'不工作,尝试清洁项目的构建产品文件夹。按住 Option (alt) 键并从“产品”菜单中选择清理构建文件夹...。 (您需要按住 Option 键,否则您将看不到该菜单选项。)

A couple of tips:

First, if you're looking for the view where Xcode annotates the project with arrows, bear in mind that you may need to expand the top-level analyser result in Xcode's Issue navigator and click the second-level issue in order to see those - see screenshots.

Screenshot 1: top-level issue selected - no arrows

enter image description here

Screenshot 2: second-level issue selected - arrows!

enter image description here

Second tip: if that stuff isn't working, try cleaning the project's build products folder. Hold down the Option (alt) key and choose Clean Build Folder... from the Product menu. (You need to hold down the Option key, otherwise you won't see that menu option.)

北城孤痞 2024-11-12 14:47:09

我以前有时见过这种情况发生。我相信这是 Xcode 中的一个错误。重新启动 Xcode 并重试。

I've seen this happen before sometimes. I believe it's a bug in Xcode. Restart Xcode and try again.

梦屿孤独相伴 2024-11-12 14:47:09

一张纸条。我在当前项目外部引用的文件中看到了这一点。我目前有一个库,其中存在缺少注释的文件,并且只需将它们添加到我当前的项目中而不复制它们。尚未完成项目依赖项设置,因此如果您引用项目外部的文件,这可能就是原因。 (我打开了库项目,进行了分析,注释出现了。)

One note. I'm seeing this for files that are referenced outside the current project. I currently have a library in which the files with missing annotations live and simply added them to my current project without copying them. Haven't done the project dependency setup yet, so if you're referring to files outside your project that could be why. (I opened the library project, did an analyze and the annotations showed up.)

独﹏钓一江月 2024-11-12 14:47:09

哇哦,我已经成功了!至少对我来说。我已经为这个问题苦苦挣扎了大约 2 个小时,尝试了这里建议的所有内容以及更多内容(Xcode 4.0.2,Snow Leopard)。奇怪的是,我有一个文件,其中警告正确显示在编辑器中。然后我注意到与所有其他文件的区别;在文件检查器窗格中,位置被指定为“相对于项目”(警告在编辑器中正确显示),所有其他项目文件都是“相对于组”(警告未在编辑器中显示)编辑器)。

我拿了一个问题文件,将其位置切换到“相对于项目”,重新分析并宾果游戏!我在编辑器中看到了它的警告。

我想这与大卫·古丁(David Goodine)关于项目外部文件的回答有点联系。

Woohoo, I've nailed it! At least for me. I've been struggling with this problem for about 2 hours now, trying out all the things suggested here and more (Xcode 4.0.2, Snow Leopard). Bizarre thing was I had one file where the warning were correctly showing in the editor. Then I noticed the difference to all other files; in the File Inspector pane the location was specified as "Relative to Project" (warnings show correctly in the editor), all the other project files were "Relative to Group" (warnings not showing in the editor).

I took one of the problem files, switched it's location to "Relative to Project", reanalyzed and bingo! I've see it's warnings in the editor.

I guess this ties in a bit with David Goodine's answer refering to files outside the project.

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