Xcode 7 编译错误:“由于信号导致命令失败:分段错误:11" [英] Xcode 7 compile error : "Command failed due to signal: Segmentation fault: 11"
问题描述
昨天我安装了官方的 Xcode 7,当我试图打开我的一个 Swift 项目时,出现一个警告,说新的 Xcode 版本想要更新我的 swift 代码(或类似的东西).好的,我接受了,然后出现 "Command failed due to signal: Segmentation fault: 11"
编译错误(如果你想了解这方面的详细信息,我可以写出整个错误文本).有人有同样的问题吗?
Yesterday I installed the official Xcode 7 and when I tried to open one of my Swift projects, appeared an alert saying that the new Xcode version wants to update my swift code (or something like this). Okay, I accepted and after this appeared "Command failed due to signal: Segmentation fault: 11"
compile error (if you want details about this, I can write the whole error text). Anyone have the same issue?
谢谢
已编辑
我重新安装了 Xcode 6.4,一切正常,没有编译错误.
I installed back Xcode 6.4 and it's okay, no compilation errors.
推荐答案
天哪,这是 Xcode 的一个了不起的错误.只需阅读此内容.http://blog.bellebethcooper.com/xcode-bug.html它让我微笑.
Omg, this is a terrific bug of Xcode. Just read this. http://blog.bellebethcooper.com/xcode-bug.html It made me smile.
变化看似很小,但实际情况如下(在我的 API 客户端类中,我实际上是从 API 获取 JSON 数据的地方):
The change was deceptively small, but here's what it was (inside my API client class, where I actually get the JSON data from the API):
我改变了这个:
`let json = try? NSJSONSerialization.JSONObjectWithData(data, options: [])`
为此:
`let json = try? NSJSONSerialization.JSONObjectWithData(data, options: []) as! [String: AnyObject]`
这是我经历过的最令人沮丧的调试体验之一有,但我希望这篇文章可以帮助其他有相同情况的人问题.如果你最终通过谷歌搜索一个错误你正在挣扎和这没有帮助你,我很抱歉.我确切地知道什么你正在经历.不要放弃!
This is one of the most frustrating debugging experiences I've ever had, but I hope this post might help someone else who has the same issue. And if you ended up here via googling a bug you're struggling with and this didn't help you, I'm so sorry. I know exactly what you're going through. Don't give up!
这篇关于Xcode 7 编译错误:“由于信号导致命令失败:分段错误:11"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!