Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

indexing - Swift Xcode Index Freezing or Slow

Maybe this is just me experiencing such an annoying "feature":

After upgrading from Xcode 6.0.1 to Xcode 6.1, things changed. Xcode 6.1 is forever indexing the project or compiling source files. The project is not a huge one. It just contains a bunch of Swift files and AWS SDK 2.0 Cocoapods in the workspace. I don't think it should prevent the whole to index and compile smoothly. I tried with some aws-sdk-ios-samples, just to see how Xcode 6.1 works on them, and it ended up in the same forever waiting.

What solutions I have tried so far:

  1. Deleting "Derived Data" in the Organizer, and re-open and workspace. (fail to fix)
  2. "Show Package Contents" on the .xcodeproj file and deleting .xcworkspace as in (Xcode 4 - slow performance)

None of them worked, unfortunately.

P.S. maybe I should try re-creating the project? My computer settings: MacBook Pro (Retina, 13-inch, Mid 2014), Memory 8 GB 1600 MHz DDR3, with Yosemite. (I think this is enough for running this small project.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I tried many of the suggestions above including splitting files, installing Xcode 6.2 beta, and breaking string concatenation statements. What finally did it for me was splitting an array of dictionaries literal declaration I was using for test data into multiple .append statements.

// This causes indexing/building to hang...
var test = [ [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ] ]

// This works fine.
var test = [ [ "a": false, "b": "c" ] ]
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])

Also, for what it's worth, the 6th entry in this array is what causes the issue for me; five works just fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...