Xcode 6 Beta 无法编译 [英] Xcode 6 Beta not compiling

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

问题描述

我遇到了以下问题:我已经编写了我的第一个 Swift 应用程序(适用于 iOS7)并且运行良好.在更改了一些小细节(在某处添加了一个字符串)之后,它就不会再编译了,即使我把所有东西都改回了以前的样子.

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.

没有错误消息或类似的东西,它说它正在构建项目(编译 Swift 源文件)但它根本没有进展,即使经过数小时的构建".

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".

我已经在 Xcode 6 b1 和 b2 上尝试过,两者都是一样的:所有其他项目都在编译没有任何问题,这个项目卡住了.

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.

错误代码:

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

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

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