Call can throw but it is not marked with try
2015-12-09 18:22
471 查看
错误原因:
let dic = NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)
正确写法:
do {
let jsonData = try NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)
print(jsonData)
} catch {
}
let dic = NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)
正确写法:
do {
let jsonData = try NSJSONSerialization.JSONObjectWithData(datas!, options: .MutableContainers)
print(jsonData)
} catch {
}
相关文章推荐
- ListView不同布局的item的复用方法详解
- 程序日志
- [原创作品]一个实用的js倒计时器 postby:zhutty.cnblogs.com
- html设置编码
- 链表经典例题
- Wince C#只运行一个实例有解决办法
- Stream API:从迭代器到Stream操作
- Valid Parentheses
- 2016年腾讯校园招聘试题解析
- Android sensor架构(二)SystemSensorManager以及JNI、sensorService(and5.1)
- Visual C++ Tips: 程序执行路径,一个容易被忽视的问题
- NSAssert宏的记录
- Crontab的格式
- UEFI启动模式安装ubuntu指南
- 源码探索系列2---深入解析AsyncTask
- 理论与实践在创新过程中的作用
- Bug 4---warning C4996: 'strcpy': This function or variable may be unsafe.
- [leetcode] 198. House Robber
- 中文转 拼音字母、全拼 工具类
- 【二】MongoDB入门