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?
相关问题
- Google places autocomplete suggestion without coun
- Xcode debugger displays incorrect values for varia
- Image loads in simulator but not device?
- importing files from other directories in xcode
- XCode Server: Opening import file for module '
相关文章
- Set the z-index value of a jQuery autocomplete inp
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Popover segue to static cell UITableView causes co
- “Storyboard.storyboard” could not be opened
- didBeginContact:(SKPhysicsContact *)contact not in
-
The file “
.app” couldn’t be opened becaus
Just lost a day trying to solve the autocomplete nightmare of Xcode (9.2). Deleting derived data seemed to work briefly then things reverted. Reboots etc and other suggested voodoo failed to make a difference.
I gave up and download the 30 day trial of AppCode from Jet Brains. Autocomplete worked fine there and this maybe coincidence but it then started working again in my project in Xcode. Can't guarantee that it'll keep working...
My case might appear too specific to help, but it might give someone an idea of how to solve broken auto-completion. Xcode 10.2.1.
In my case, auto-complete stopped working entirely and non of these other answers helped me. In addition, the fan on the computer could be heard to go louder indicating something was overworking (no other apps running), it should be noted I was editing on a MacBook Pro laptop. It seemed to be linked with the editor struggling to parse the equation I'd written:
I was looking to animate a text view left, right, or to the middle depending on user prefs. The
newPosition
is aCGPoint
that the text will animate to. Anyway, I split the equations up and all of a sudden auto-complete started working and the fan went quiet! I've been able to recreate this specific problem more than once by re-typing the above code and then replacing it with:I had the issue with 100% not working auto-complete, none of written here helped. One thing I noticed – it was broken right after adding some entities into .xcdatamodel file, which have codegen class definition by default.
So I wasn't surprised when using old-style codegen none (and generating classes of course) fixed the issue immediately, even without restarting the xcode.
Use
Command + B
or
Command + R
to Build or Run the projectXcode sometimes messes up ;)
Things to try:
1
Run this command in the project directory if you use cocoapods:
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 Folder3
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
statementsThis can happen when the file is not a member of the Target. Open the file where autocomplete is not working and show the the "Utilities" tab in the top right of Xcode (blue in the screenshot below).
Ensure your Target (typically your app's name) is checked. Autocomplete should work almost instantly without restarting Xcode, cleaning, or deleting Derived Data.