Xcode 6 Beta不编译 [英] Xcode 6 Beta not compiling

查看:145
本文介绍了Xcode 6 Beta不编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:
我写了我的第一个Swift应用程序(iOS7),它工作正常。
改变一些细节后(在某处添加一个字符串),它不会再编译了,即使我改变了一切回到之前的样子。



没有错误消息或任何类似的东西,它说,它正在建设的项目(编译Swift源文件),但它不是进步,即使在建设的小时后。



我试过它与Xcode 6 b1和b2和两个是一样的:所有其他项目编译没有任何问题,这一个得到了卡住。



任何人都有一个线索可能是问题和如何解决它?

解决方案

调试代码手动为我工作。 p>

最后,我发现问题的根本原因是一行中的字符串连接过多。



错误代码: / p>

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

修正代码:

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


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?

解决方案

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

这篇关于Xcode 6 Beta不编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆