将我的测试应用程序升级到swift 2。
private func parsePeopleFromData(peopleData : NSData) -> [Person] {
var people = [Person]()
let jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData(peopleData, options: NSJSONReadingOptions.MutableContainers, error : nil) as! NSDictionary
if let rawPeople = rawPeopleDataFromJSON(jsonResult) {
people = parsePeopleFromRaw(rawPeople)
}
return people
}
它显示以下行的错误,特别是错误:nil
let jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData(peopleData, options: NSJSONReadingOptions.MutableContainers, error : nil) as! NSDictionary
帮我解决问题。提前谢谢。