简体   繁体   中英

XCode Swift autocomplete breaks down after build

I've got a project that started out two years ago as Obj-C, but recently has had a number of Swift 2.0 additions. Right now the ratio is about 75%/25% in favor of Obj-C, but growing towards Swift.

Common with older projects, right? Here's the problem: ever since XCode 7.3 I can't get code completion to work properly in Swift.

I take these steps:

  • Close Xcode
  • Terminal -> rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • Terminal -> rm -rf ~/Library/Caches/com.apple.dt.Xcode

and all is good. But as soon as I do a full build of the XCode project, the problem's back and Swift doesn't code-complete until I remove the derived data again (either manually or through XCode), and re-index all the files.

Objective-C does complete, and the default and manually created macros also still work. It's just the indexing that seems to break.

Please, has anyone heard of this behaviour and know a fix for it? It's great Swift training to have to type everything manually, but some of my methods have multiple block-parameters and it becomes a pain to write them out.

If it matters at all, I've been using Swift 2.0 up to 2.2 syntax in the newer classes.

have you checked your deployment target? i find out it it always works on 10.12 : 在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM