我在这段代码上有这个错误,任何人都可以告诉我如何在Swift 2.0中更改它
if jsonResponse != nil {
propertyListResponse = NSJSONSerialization.JSONObjectWithData(jsonResponse,
options: NSJSONReadingOptions.MutableLeaves,
error: nil)
答案 0 :(得分:0)
删除参数列表中的错误
if jsonResponse != nil { propertyListResponse = try NSJSONSerialization.JSONObjectWithData( jsonResponse, options: NSJSONReadingOptions.MutableLeaves )
...
catch let error as NSError {
// error handling
print(error)
}
}