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:
Try:
- Go to Xcode > Preferences > Text Editing
- Under Code completion - Uncheck 'Suggest completions while typing'
- Quit out of Xcode and then relaunch Xcode.
- Go to Xcode > Preferences > Text Editing again
- Quit out of Xcode and then relaunch Xcode.
- Now go to Code completion and check 'Suggest completions while typing'.
- Try typing library function or enum and enjoy!
回答2:
Deleting the DERIVED DATA folder seemed to fix my issue. Thanks to this post: swift println() not showing autocomplete options while writting code
回答3:
Things to try:
1
Run this command in the project directory if you use cocoapods:
rm -rf ~/Library/Caches/CocoaPods;
rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*;
pod deintegrate; pod setup; pod install;
2
Clean Cached Data
Clean the Project -> Cmd+Shift+K
Clean the Build Folder -> Cmd+Shift+Option+K
If you skipped step one:
Delete Derived Data
Xcode Preferences
-> Locations
->
Arrow Symbol Takes you to DerrivedData
-> Delete Folder
3
Check your Build Phase's Compile Sources.
Every .swift
and .m
file in the project should be in this list or it won't autocomplete in those files.
4
Optimize your Editor:
Use fileprivate on every class property and function that you can to reduce the scope of the Compilers work per item.
Write modular/OOP code so you have less code for the compiler to read.
Avoid using Type Inferance when the result is a complex calculation, and try to break down complex calculations into let this = smallerOperation
statements
回答4:
Xcode Version 11.0 (11A420a)
I have tried the solution from Lal Krishna for Xcode V11.0. It worked a few times but later I got no result.
I found one solution. You must delete two files:
- Library/Developer/Xcode/Derived Data (as described before)
- Library/Developer/Xcode/UserData/IDEEditorInteractivityHistory
That solution helps me now. May be useful for others