Xcode swift indexing forever

前端 未结 25 1686
不知归路
不知归路 2020-11-30 03:15

I\'m currently developing an iOS app using swift and Xcode 6 (Beta 3).

Everything went fine so far but now as my project grows, Xcode suddenly began indexing and it

相关标签:
25条回答
  • 2020-11-30 03:27

    It's XCode bug. Problem caused with concatenation in one line:

    var value = "some text" // it can be String or Array
    value = value + value1 + value2 + value3 + value4 + value5 + value6 // etc
    

    This correction fixes this bug:

    var value = "some text"
    value += value1
    value += value2
    value += value3
    value += value4
    value += value5
    value += value6
    
    0 讨论(0)
  • 2020-11-30 03:30

    Killing the processes named 'swift' and then checking the error in xcode will give you the part of the code giving you trouble. There are some bugs in swift that needs to be circumvented.

    To kill the process: Applications > Utilities > Activity Monitor. Then find the "swift" process, double click and choose Quit or Force Quit.

    0 讨论(0)
  • 2020-11-30 03:31

    I got this issue and 6 hours later (after trying everithing and build new project again step by step copying resources) I FOUND MY PROBLEM:

    class A : A {
    ...
    }
    

    By the fact of copy/paste I had a class that extends itself, and this makes indexing crazy.

    0 讨论(0)
  • 2020-11-30 03:33

    Backup your project delete the lastone and restart the xcode simple :-)

    0 讨论(0)
  • 2020-11-30 03:37

    I had the same issue in my code. The solution for me was delete all spaces in the array in my code.

    Ex.

      struct Objects {
    
      let objectA = ["text1", 
                     "text2", 
                     "text3", 
                     "text4"] }
    

    // Noise, CPU 100% and Index forever. The solution is...

    struct Objects {
        let objectA = ["text1","text2","text3","text4"]}
    

    // Solved making the Array or String with no space.

    0 讨论(0)
  • 2020-11-30 03:38

    In my case the issue was caused by some aritmetic sums. I was creating a collectionView with all the different frames programmatically doing it like this:

    cell.textView.frame = CGRectMake(8 + 10 + 12, 0, 150 + 6 + 6 + 4, 50)
    

    I just changed it to:

    cell.textView.frame = CGRectMake(30, 0, 166, 50)
    

    It helps me figure out the margins and paddings more easily, but just puting the result of the sum changed the build speed from 5 - 7 minutes to 20 seconds or so.

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