Xcode失败,退出代码为254

时间:2014-07-08 10:54:35

标签: ios compiler-errors segmentation-fault swift xcode6

我找了解决方案,但我一无所获。与XCode 6的beta 3一样,我的代码不再适用。 Xcode给我发回了这个错误:

  

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

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

1 个答案:

答案 0 :(得分:3)

对我来说同样的问题,但在我的案例中有收集视图。我发现它是由行引起的:

let cell = collectionView?.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as CustomCell

我刚将其改为:

let cell = collectionView!.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as CustomCell

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

更新:

注意到beta3中的方法签名发生了变化,而且在你的情况下,collectionView(在你的情况下为tableView)被强制解包:

override func collectionView(collectionView: UICollectionView**!**, cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionViewCell!

因此我们需要修复数据源方法并直接使用collectionView或tableView。