【发布时间】:2015-10-29 21:32:47
【问题描述】:
我试过转换工具更新这几行代码,可惜进程没有赶上这两个错误。
您能否帮助我了解是否需要引入 do { 和错误处理? (我是 swift 新手!)。
我收到的错误信息如下:“Call can throw, but it is not mark with 'try' and the error is not processed”
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
query.findObjectsInBackgroundWithBlock {(result: [PFObject]?, error: NSError?) -> Void in
self.posts = result as? [Post] ?? []
// 1
for post in self.posts {
// 2
let data = post.imageFile?.getData() --> this is where I get the error message
// 3
post.image = UIImage(data: data!, scale:1.0)
}
self.tableview.reloadData()
}
【问题讨论】:
标签: parse-platform error-handling swift2