Xcode 7.3.1 自动完成代码完成不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37048529/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:47:36  来源:igfitidea点击:

Xcode 7.3.1 autocomplete code completion not working

iosiphonexcodeautocompletecode-completion

提问by mashdup

Ever since Xcode 7.3 the autocompletion or code completion doesn't work properly.

自 Xcode 7.3 以来,自动完成或代码完成无法正常工作。

Simple import class and it can't autocomplete

简单的导入类,它不能自动完成

I have tried:

我试过了:

  • Deleting Derived Data folder
  • Clean Targets and Build
  • Reinstalling Xcode
  • 删除派生数据文件夹
  • 清理目标并构建
  • 重新安装Xcode

It does autocomplete after you type it out fully the first time. But if you haven't referenced it once (i.e. like enums) it only shows what you typed out before (not showing full list of enums). Pressing escape doesn't help either.

第一次完全输入后,它会自动完成。但是如果你没有引用它一次(即像枚举),它只会显示你之前输入的内容(不显示完整的枚举列表)。按 Esc 也无济于事。

Any other suggestions? Or anyone else experiencing the same?

还有其他建议吗?或者有没有其他人遇到同样的情况?

采纳答案by Tunceren

Without doing anything, In Build-Settings -> Deployment changing iOS Deployment target from 8.0 to 8.1 resolved the issue for me.

没有做任何事情,在 Build-Settings -> Deployment 中将 iOS 部署目标从 8.0 更改为 8.1 为我解决了这个问题。

enter image description here

在此处输入图片说明

It also works for XCode 6 as mentioned here

它也适用于这里提到的 XCode 6

Also works on Xcode 8, Simply change the deployment target from iOS 9.0 to iOS 9.1.

也适用于 Xcode 8,只需将部署目标从 iOS 9.0 更改为 iOS 9.1。

回答by mashdup

Xcode 8 has now fixed this very annoying autocomplete issue. So anyone who is still having this problem, update to Xcode 8.

Xcode 8 现在已经修复了这个非常烦人的自动完成问题。所以任何仍然有这个问题的人,更新到 Xcode 8。

Edit: Please note, this has not solved for others. So your milage may vary. For me, it has fixed without doing anything extra. But they are using their new 'intelligent' autocomplete. Thinking about it, it could be part of the indexing. Deleting the DerivedData folder could help.

编辑:请注意,这还没有为其他人解决。所以你的里程可能会有所不同。对我来说,它已经修复而没有做任何额外的事情。但是他们正在使用他们新的“智能”自动完成功能。考虑一下,它可能是索引的一部分。删除 DerivedData 文件夹可能会有所帮助。

回答by MRizwan33

This Happen usually when you are using core Data in your project.(because of automatic indexing of files by xcode not been done) The simple way to avoid this thing is that just click to your project name and clean project come back the same file where you wanna see suggestions type any word and thats it.

这通常发生在您在项目中使用核心数据时。(因为没有通过 xcode 自动索引文件)避免这种事情的简单方法是只需单击您的项目名称并清理项目返回相同的文件你想看到建议输入任何单词,就是这样。

回答by Lawliet

There is a way to set shortcut keys for code completion. Xcode-> Preferences-> Key Bindings-> find Show Completionsand set whatever non-duplicate keys you want.

有一种方法可以设置代码完成的快捷键。Xcode-> Preferences-> Key Bindings-> 找到Show Completions并设置你想要的任何非重复键。

enter image description here

在此处输入图片说明

回答by Luiz Dur?es

Perhaps, this answer is too late, I'll share it anyway.

也许,这个答案为时已晚,无论如何我都会分享。

First of all, I've uninstalled Alcatraz and all plugins.

首先,我已经卸载了 Alcatraz 和所有插件。

Second, I've followed ElonChan's instructions explained on:

其次,我已经按照 ElonChan 的说明进行了解释:

Xcode 7.3 autocomplete issues

Xcode 7.3 自动完成问题

As a result, autocompletion automagically got back! Thanks @ElonChan.

结果,自动完成自动恢复了!谢谢@ElonChan。

I hope this answer also solves your problem.

我希望这个答案也能解决你的问题。