Xcode:代码丢失了语法着色 [英] Xcode: code loses syntax coloring

查看:35
本文介绍了Xcode:代码丢失了语法着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在各种情况下,Xcode 3.1 (Leopard) 中的 Objective-C 代码在键入后可能无法获得适当的语法着色或丢失其具有的着色.

I find that in various situations Objective-C code in Xcode 3.1 (Leopard) can fail to get appropriate syntax coloring after typing or lose coloring that it had.

这不仅是新自定义符号的刷新"问题,还会影响 Cocoa 框架符号.

This isn't just a "refresh" issue with new custom symbols -- but affects Cocoa framework symbols as well.

有时 CMD-a 选择代码页上的所有文本会使颜色(重新)出现,有时双击一行选择它会起作用,有时我必须在符号中添加/删除一个空格使该符号(重新)着色.重建或关闭/重新打开项目可能有效,也可能无效.

Sometimes CMD-a to select all text on the code page will make the coloring (re)appear, sometimes double-clicking on a line to select it will work, sometimes I have to add/delete a space in a symbol to get that symbol to (re)color. Rebuilding, or closing/reopening the project may or may not work.

这是 Xcode 的已知问题吗?对于让我如此恼火的事情,我没有在 SO 和我期望的其他地方找到对它的大量讨论.

Is this a known issue with Xcode? For something so annoying to me, I'm not finding the plentiful discussions of it on SO and elsewhere I'd expect.

是否有强制全局语法重新着色的命令?

And is there any command to force global syntax recoloring?

推荐答案

1.) 转到项目 --> 构建设置 --> 标题搜索路径

1.) Go to Project --> Build Settings --> Header Search Paths

2.) 添加$(SRCROOT)/**"

2.) Add "$(SRCROOT)/**"

3.) 关闭并重新加载项目

3.) Close and reload the project

4.) 转到 Xcode --> Window --> Organizer --> Projects --> $YourProject --> 删除派生数据

4.) Go to Xcode --> Window --> Organizer --> Projects --> $YourProject --> Delete Derived Data

5.) 稍等片刻,直到 XCode 重建所有索引

5.) Wait a moment until XCode rebuild all indicies

要获取更多信息,请激活详细日志记录:

To get more information activate verbose logging:

1.) 在终端应用中增加 Xcode 日志级别:默认写入 com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3

1.) Increase Xcode log level in Terminal app: defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3

2.) 打开控制台应用程序.搜索xcode"

2.) Open Console app. Search for "xcode"

3.) 我看到 pch 文件中提到的头文件的找不到文件"错误(因此上面的修复)

3.) I saw "file not found" errors for header files mentioned in the pch file (therefore the fix above)

这篇关于Xcode:代码丢失了语法着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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