Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 Beta not compiling

I've got the following problem: I've written my first Swift App (for iOS7) and it worked fine. After changing some minor detail (adding a string somewhere) it wouldn't compile anymore, even if I changed everything back how it was before.

There is no error message or anything like it, it says that it's building the project (Compiling Swift Source Files) but it's not progressing at all, even after hours of "building".

I've tried it with Xcode 6 b1 and b2 and with both it's the same: all the other projects are compiling without any problems, this one get's stuck.

Does anyone have a clue what might be the problem and how to solve it?

like image 518
Luca Avatar asked Jun 19 '14 15:06

Luca


3 Answers

Debug the code manually works for me.

Finally I find the root cause of my problem is too many string concatenation in one line.

Bug code:

var string = string1 + string2 + string3 + string4 + string5 + string6 + string7 + string8 

Fixed code:

var string = string1
string += string2
string += string3
string += string4
string += string5
string += string6
string += string7
string += string8
like image 152
Zhenshan Yu Avatar answered Sep 22 '22 00:09

Zhenshan Yu


Xcode 6 Beta sometimes does not show any error but there will be some errors in your code. Because of that it does not compile.

Try to comment different parts of code and then try to compile. You have to find out the error manually.

I had this issue because I had some errors in my code but it was not showing.

Debug it manually. All the best.

like image 2
vntstudy Avatar answered Sep 20 '22 00:09

vntstudy


Xcode 6 Beta 5 went into a tailspin for me immediately after I wrote out an expression to concatenate 3 strings and an NSDate object with the "+" operator.

Wouldn't compile and got stuck indexing.

Search your code for long string concats and remove for now. This is clearly a bug.

like image 1
Sam Avatar answered Sep 22 '22 00:09

Sam