Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
701 views
in Technique[技术] by (71.8m points)

swift - Xcode 7 compile error : "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?

Thanks

Edited

I installed back Xcode 6.4 and it's okay, no compilation errors.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Omg, this is a terrific bug of Xcode. Just read this. http://blog.bellebethcooper.com/xcode-bug.html It made me smile.

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):

I changed this:

`let json = try? NSJSONSerialization.JSONObjectWithData(data, options: [])`

to this:

`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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...