额外的争论'错误'在电话里 - 迅捷2

时间:2015-10-02 18:20:29

标签: xcode swift2

将我的测试应用程序升级到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

帮我解决问题。提前谢谢。

0 个答案:

没有答案