Xcode 6 Swift code completion not working

后端 未结 13 1054
感情败类
感情败类 2020-11-28 08:11

Using Xcode 6 GM seed my code completion has stopped working. It was working the other day. I was trying to get the unwind segue work around to work. I had made an Objc head

相关标签:
13条回答
  • 2020-11-28 08:16

    In my case Some File(s) were deleted in File System but were still referenced in the Project i.e. in Red Color. Just delete those from Project and everything was fine. Code Completion started working.

    Also Like to point that all the above answers about Clearing/Deleting Derived Data folder seems to work momentarily but whenever there was a new pull or update the problem started again, so the root cause was the unreferenced/moved/deleted files which show up as RED in the project, they needs to be manually cleared.

    0 讨论(0)
  • 2020-11-28 08:18

    Another possible reason why it isn't working is because it's not part of the target membership. To fix this, select the file you're working on. Then, go to the File Inspector and in the Target Membership section, make sure your project is checked.

    0 讨论(0)
  • 2020-11-28 08:21

    There's an easier way to delete the Derived Data from within Xcode (no need to open finder or restart):

    Xcode Organizer -> Projects -> (Your Project) -> Delete Derived Data

    0 讨论(0)
  • 2020-11-28 08:24

    This fix from apple dev forums works for me. I have had autocomplete issues with Xcode 6.1/Yosemite.

    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), precisely run, a) cd ~/Library/Developer/Xcode/DerivedData/
      b) rm -rf *

    1. (Try this if Steps 1-3 dont really work as it rebuilds the cache later on restart which takes time) Delete the contents of folder ~/Library/Caches/com.apple.dt.Xcode, i.e.,
      a) cd ~/Library/Caches/com.apple.dt.Xcode
      b) rm -rf *

    Now launch Xcode once more…

    0 讨论(0)
  • 2020-11-28 08:26

    I experienced a serious breakdown of code completion because I had some 'notes' after the @end statement of my .m file which were as follows:

    /*
     NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
     */
    

    These lines can appear before the @end statement without destroying code completion.

    0 讨论(0)
  • 2020-11-28 08:27

    Try the following - as silly as it may sound: Change Device to iPhone 6, close Xcode, Reopen Xcode and wait for the indexing to finish.

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