XCode 6 GM: Constantly freezing / locking while editing Swift code

后端 未结 3 1304
北恋
北恋 2021-01-18 21:11

Since installing XCode 6 GM, it has been freezing and locking, showing the spinning wheel of death while I attempt to edit code that has syntax errors. Has anyone else seen

相关标签:
3条回答
  • 2021-01-18 21:23

    I create a new tab via menu File->New Tab and close the old tab that is frozen.

    CmdT does not work that time.

    0 讨论(0)
  • 2021-01-18 21:34

    I can't say any of these fixed the issue, but they alleviated the situation:

    1. I removed all playgrounds from the project tree. Saved them somewhere else.
    2. I removed all objectiveC code from the swift project (when possible). This Spinning-wheel, BTW, is a problem only in my swift projects. My other Objective-C-only projects are fine.
    3. It looks like it's the background indexing process which is taking all the CPU. Open "Activity Monitor" and see it right there at the top, using 360% CPU. Lowering the priority for this process helped as well (type in terminal):

      renice 10 -p [pid]

      Make sure to take the correct process id from Activity Monitor. The higher the number (should not exceed 19) the lower the priority.

    4. I make significant changes one at a time. It seems that the amount of errors in the file affect how many times and for how long the spinning wheel spins. It looks like some type of errors trigger it more often than others, but I'm not able to pin point which exactly.

    XCode had a similar indexing issue in previous versions (see this Xcode4 issue: How to disable indexing in Xcode 4?) which gives me the hope they will fix this issue sometime, hopefully soon...

    0 讨论(0)
  • 2021-01-18 21:35

    You should look if you have any imports missing in your bridging header file. Sometimes even commented out imports will cause this behaviour. For me it was commented out Pixate Freestyle Cocoa Pod. I had to remove pod completely from my project to stop SourceKitService from crashing.

    https://stackoverflow.com/a/25173389/527539

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