Xcode失败,退出代码为254

And*_*ath 8 compiler-errors segmentation-fault ios swift xcode6

我找了一个解决方案,但我一无所获.与XCode 6的beta 3一样,我的代码不再起作用了.Xcode将此错误返回给我:

在/Users/Marco/Desktop/iPrescription/iPrescription/MedicineTableViewController.swift:109:14:0发出'tableView'的SIL时:错误:无法执行命令:分段错误:11:0:错误:swift前端命令失败到期发信号(使用-v查看调用)命令/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift失败,退出代码为254

我是ios编程的新手,我不知道如何找到这个问题的根源.我非常沮丧,因为我不知道在寻找什么.

Ily*_*kin 3

对我来说也是同样的问题,但在我的例子中是集合视图。我发现它是由线路引起的:

let cell = collectionView?.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as CustomCell
Run Code Online (Sandbox Code Playgroud)

我刚刚将其更改为:

let cell = collectionView!.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as CustomCell
Run Code Online (Sandbox Code Playgroud)

我的应用程序又恢复了生机。还是不知道为什么。

更新:

只是注意到 beta3 中的方法签名发生了变化,并且 collectionView (在您的情况下为 tableView)被迫解开:

override func collectionView(collectionView: UICollectionView**!**, cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionViewCell!
Run Code Online (Sandbox Code Playgroud)

所以我们需要修复数据源方法,直接使用collectionView或者tableView。