您的位置:首页 > 其它

Call can throw but it is not marked with try

2015-12-09 18:22 405 查看
错误原因:

let dic =  NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)

正确写法:

        do {

                let jsonData = try NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)

                print(jsonData)

               

            } catch {

               

            }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: