Xcode 7 compile error : “Command failed due to signal: Segmentation fault: 11”

前端 未结 25 2442
耶瑟儿~
耶瑟儿~ 2020-12-01 05:37

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 co

25条回答
  •  误落风尘
    2020-12-01 06:07

    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!

提交回复
热议问题