升级到 Swift 2.0 时出现分段错误 11 [英] Segmentation Fault 11 on upgrading to Swift 2.0

查看:25
本文介绍了升级到 Swift 2.0 时出现分段错误 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 iOS 项目,截至昨天,它运行良好.现在我已经更新到 Xcode 7,带来了 Swift 2.0 语法.我按照使用新语法的建议解决了所有错误.当我尝试构建时,构建失败并显示由于信号导致命令失败:分段错误:11".这发生在 4 个不同的文件上.

I have an iOS project that as of yesterday was working perfectly. Now I've updated to Xcode 7, bringing Swift 2.0 syntax. I went through and resolved all the errors as suggested to use new syntax. When I try to build, the build fails with a "Command failed due to signal: Segmentation fault: 11". This occurs on 4 different files.

问题是,这四个文件没有任何需要更新的代码,而且是非常简单的文件(其中除了将标签设置为属性值之外什么都不做).什么给?

The problem is, those four files didn't have any code that needed updating, and are quite simple files (on of them doesn't do anything but set a label to a property value). What gives?

推荐答案

我想通了.问题是编译器没有捕捉到几个错误.我让 Xcode 通过删除文件来查找错误,然后重新添加它.这表明还有 30 多个错误,这些错误在修复后会导致我的代码完全编译.

I figured it out. The problem was that there were several errors that the compiler was not catching. I got Xcode to find the errors by deleting a file, and then re-adding it. This showed thirty-something more errors that, when fixed, caused my code to compile completely.

这篇关于升级到 Swift 2.0 时出现分段错误 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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