Xcode 9 自动完成不工作 100% - 部分工作 [英] Xcode 9 Autocomplete Not Working 100% - Partially Working

查看:16
本文介绍了Xcode 9 自动完成不工作 100% - 部分工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上,Xcode 9.0 (9A235) 显示了一个新的/奇怪的自动完成框,它与以前完全不同.我如何获得完整的自动完成框,以便自动完成看起来像它通常的样子?

This morning, Xcode 9.0 (9A235) shows a new/strange Auto Complete box that is not at all what it used to be. How do I get the full auto-complete box so that autocomplete looks like how it usually does?

推荐答案

要尝试的事情:#1如果使用 cocoapods,请在项目目录中运行此命令:

rm -rf ~/Library/Caches/CocoaPods;
rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*;
pod deintegrate; pod setup; pod install;


#2**清理缓存数据**

清理项目 ->Cmd+Shift+K


#2 **Clean Cached Data**

Clean the Project -> Cmd+Shift+K

清理构建文件夹 ->Cmd+Shift+Option+K

Clean the Build Folder -> Cmd+Shift+Option+K

如果您跳过了第一步:
删除派生数据
Xcode 首选项 ->位置 ->
箭头符号带你到 DerivedData ->删除文件夹

If you skipped step one:
Delete Derived Data
Xcode Preferences -> Locations ->
Arrow Symbol Takes you to DerrivedData -> Delete Folder

项目中的每个 .swift.m 文件都应该在这个列表中,否则它不会在这些文件中自动完成.

Every .swift and .m file in the project should be in this list or it won't autocomplete in those files.

在每个类属性和函数上使用 fileprivate*,您可以减少每个项目的编译器工作范围.

Use fileprivate* on every class property and function that you can to reduce the scope of the Compilers work per item.

编写模块化/OOP 代码,以便编译器读取更少的代码.

Write modular/OOP code so you have less code for the compiler to read.

当结果是复杂计算时避免使用类型推断,并尝试将复杂计算分解为let this =smallerOperation语句

Avoid using Type Inferance when the result is a complex calculation, and try to break down complex calculations into let this = smallerOperation statements

* 在 Swift 4 中 private 变得比 fileprivate 更严格

* In Swift 4 private became stricter than fileprivate

在 Xcode 12 中,删除派生数据的频率有了显着改进(尽管冻结增加了).

In Xcode 12 there have been significant improvements in how often deleting derived data is necessary (though freezing has increased).

这篇关于Xcode 9 自动完成不工作 100% - 部分工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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