XCode 6 自动完成停止工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25373554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XCode 6 autocomplete stopped working
提问by Maxim Tsybanov
XCode 6 Beta 5 and autocomplete stopped working. I thought problem in Beta 5 but I've reinstall to Beta 4 and it's still not work but it did before. I check preferences for "suggests" and I tried to delete Derived Data but it doesn't help
XCode 6 Beta 5 和自动完成停止工作。我认为 Beta 5 有问题,但我已经重新安装到 Beta 4,但它仍然无法正常工作,但以前确实如此。我检查了“建议”的首选项,并尝试删除派生数据,但没有帮助
采纳答案by Maxim Tsybanov
I found the solution. Problem was in an array.
I have big array like:
let array:[NSString] = ["first","second"...]
I changed it to
var array = ["first","second"...]
I don't why it's happened but it works. It was so hard to find the problem.
我找到了解决方案。问题出在数组中。我有一个大数组,比如:
let array:[NSString] = ["first","second"...]
我把它改成
var array = ["first","second"...]
我不知道为什么会发生,但它有效。发现问题太难了。
回答by Gautam Jain
- Clear derived data.
- Under build settings, select Always Search User Paths to "YES".
- Clean the project.
- 清除派生数据。
- 在构建设置下,选择始终搜索用户路径为“是”。
- 清理项目。
回答by Manny
This happened to me recently because I had a /* */ style comment after the @end of my @implementation.
这最近发生在我身上,因为我在 @implementation 的 @end 之后有一个 /* */ 样式注释。
Not sure why that would break autocomplete but moving the comment into the implementation fixed autocomplete.
不知道为什么这会破坏自动完成,而是将评论移到实现固定自动完成中。
There seems to be a lot of reasons autocomplete breaks. Just adding to the list..
似乎有很多原因导致自动完成中断。只是添加到列表中..
回答by Adobels
Check if the .m file has been checked in "Target Membership"
检查 .m 文件是否已在“Target Membership”中检查
回答by Ronaldoh1
I was having this problem.
我遇到了这个问题。
This is what worked for me.
这对我有用。
- Clear derived data.
- 清除派生数据。
Window -> Organizer -> "Select you project" -> Delete Derived Data.
窗口 -> 管理器 -> “选择你的项目” -> 删除派生数据。
Clean the project
Quit Xcode ----- this is very important. You might have to restart you computer.
Open Xcode again
清理项目
退出Xcode ----- 这很重要。您可能需要重新启动计算机。
再次打开Xcode
Hope this works for you. This worked on 2/9/2015
希望这对你有用。这适用于 2/9/2015
回答by Alex Stone
Tried to clean/delete derived data multiple times. Autocomplete was disabled in some files, but not App Delegate. After a while I saw red libraries int he project navigator. Those are managed by cocoapods. The solution turned out to be:
多次尝试清理/删除派生数据。某些文件中禁用了自动完成功能,但 App Delegate 未禁用。过了一会儿,我在项目导航器中看到了红色的库。这些由可可豆管理。原来的解决方案是:
- Navigate to the project root folder
- Delete "Pods" directory
- open terminal, type cd
- drag the project folder there to get full path
- run pod install
- 导航到项目根文件夹
- 删除“Pods”目录
- 打开终端,输入cd
- 将项目文件夹拖到那里以获取完整路径
- 运行 pod 安装
Upon reinstalling pods, syntax highlighting and code completion is restored in the affected files.
重新安装 pod 后,语法突出显示和代码完成会在受影响的文件中恢复。
回答by horseshoe7
For me it was because it was a new problem since upgrading my version of Xcode. After downloading the documentation again, everything worked fine.
对我来说,这是因为升级我的 Xcode 版本后出现了一个新问题。再次下载文档后,一切正常。