更新时间:2022-05-14 00:35:13
天哪,这是 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!