Xcode 代码感知颜色/完成不起作用 [英] Xcode code sense color/completion not working

查看:39
本文介绍了Xcode 代码感知颜色/完成不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这很奇怪...如果我在欢迎屏幕中双击该项目的最近的项目"项,代码感知和着色效果很好,但如果我只是单击 打开(欢迎屏幕右下角)它没有.从 File> 打开最近的项目 也不起作用,在 Finder 中双击 .xcodeproj 文件也不起作用.

This is weird... if I double-click the Recent Projects item for the project in the welcome screen, code sense and coloring works just fine but if I just click Open (bottom right in welcome screen) it doesn't. Opening from File > Recent projects does not work either and neither does double-clicking the .xcodeproj file in Finder.

我已经工作了几个月(通过不同的安装/版本的 Xcode)的 iPhone OS 3.0 项目的代码感知不再起作用.例如,如果我执行 NSString *myString,所有代码都是黑色的(没有着色,没有 Option + 双击,没有代码完成).Code Sense 仅有效"对于我自己的类/方法/属性,但不适用于任何 SDK 类.如果我从头开始创建一个新项目,我确实可以完成所有这些工作.

Code sense for an iPhone OS 3.0 project I have been working on for several months (through different installations/versions of Xcode) is not working any more. For instance, if I do NSString *myString, all code would be black (no coloring, no Option + Double Click, no code completion). Code Sense only "works" for my own classes/methods/properties but not for any of the SDK classes. If I create a new project from scratch I do have all of these working.

我已经尝试更改适用于所有配置的基础 SDK";在这个项目中.我已经尝试过重建代码感知索引".我已经尝试过清除所有目标".

I already tried changing the "Base SDK for All Configurations" in this project. I already tried "Rebuild Code Sense Index". I already tried "Clean All Targets".

首选项中的文档已全部下载并运行.例如,如果我选择上面的 NSString 并右键单击 ->在文档中查找文本,我得到了包含对类的所有引用的窗口.

Documentation in the Preferences is all downloaded and working. For instance, if I select the NSString above and do Right-Click -> Find text in documentation, I get the window with all the reference to the class.

任何想法将不胜感激.

推荐答案

在 Xcode 中获取项目信息并更改项目格式以匹配您使用的 Xcode 版本(在撰写本文时,Xcode 3.2-compatible").

Get Info on the project in Xcode and change the Project Format to match the version of Xcode you're using (as of this writing, "Xcode 3.2-compatible").

您也可以删除派生数据,但除非您更新了项目格式,否则该错误几乎会立即再次发生.(即使在更新您的项目格式后也可能发生,但我曾经每天必须多次删除 DerivedData,而且我想自从修复项目以来我只删除过一次.)

You can delete the derived data as well, but unless you've updated your project format the bug will reoccur almost immediately. (It may happen even after updating your project format, but I used to have to delete DerivedData several times a day, and I think I've only done it once since fixing the project.)

如其他地方所述,切换到 LLVM 可能会有所帮助.但是当我更新这个答案 (2012) 时,无论如何你都应该使用 LLVM.

As noted elsewhere, switching to LLVM may help. But as I update this answer (2012), you should be using LLVM anyway.

这篇关于Xcode 代码感知颜色/完成不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆