Xcode 6 isn't autocompleting in Swift

前端 未结 10 758
清酒与你
清酒与你 2020-11-29 15:57

I am trying to import various libraries which I can\'t remember their exact name. Unfortunately Xcode 6 (using swift) isn\'t auto completing th

相关标签:
10条回答
  • 2020-11-29 16:45

    I tried changing the Fonts & Color to default and it worked. I normally have it on MidNight2.

    0 讨论(0)
  • 2020-11-29 16:46

    The easiest way to improve xCode speed and to reuse the trick is by creating an alias and call it every time you need it:

    1.Open Terminal:
    2.Type in to your terminal ( or copy and paste ):
    alias xcodeclean="rm -frd ~/Library/Developer/Xcode/DerivedData/* && rm -frd ~/Library/Caches/com.apple.dt.Xcode/*" 3.Final step is to type xcodeclean (Remember: next time when you want to clean the xCode just call xcodeclean)

    0 讨论(0)
  • 2020-11-29 16:46

    I tried all of these, but to no avail - nothing worked. My situation is I have a Swift class "A" that after performing a large merge into my branch could no longer see several other Swift files ("B" - "F") that were located in a different Group from within my project.

    What's interesting is "A" belongs to both the main project Target, but also to the UnitTest Target whereas "B", "C", "D", "E", and "F" ONLY belonged to the main project Target.

    By including them for membership with the UnitTests also all of a sudden Xcode can now see those classes correctly - must be members in the same Targets, perhaps?

    The fixed a couple of things: 1) Code completion now works. 2) The little red error markers that are next to the line numbers ("unresolved identifier" errors) cleared up too. This last one was very annoying to me as when you CMD-B to build they clear up and the code compiles just fine / runs just fine. But, make ANY change (add a single white space, for example) and these reappeared all the time (and, of course, Code Completion would stop working again as well).

    Not sure if this is a Swift or Xcode issue but this is what fixed it for me.

    0 讨论(0)
  • 2020-11-29 16:50

    This fix from apple dev forums works for me. I have had performance/autocomplete issues since beta 5 i think and now xcode 6.1/Yosemite on my old 2010 MBP is working flawlessly.

    1. Quit Xcode.
    2. Restart the computer (this is to clear any in-memory caches).  
    3. Delete the contents of the DerivedData folder (~/Library/Developer/Xcode/DerivedData)
    4. [This is the key move:] Delete ~/Library/Caches/com.apple.dt.Xcode.

    Now launch Xcode once more…

    0 讨论(0)
提交回复
热议问题