Cha*_*era 3 warnings core-data try-catch ios swift3
我试图从核心数据中删除和反对,我在try catch中尝试了它,如下所示.
do {
try self.managedContext.deleteObject(self.productList[indexPath.row])
} catch let error as NSError {
print("something wrong with the delete : \(error.userInfo)")
}
Run Code Online (Sandbox Code Playgroud)
它说'no calls to throwing functions occur within 'try' expression和'catch block is unreachable because no errors are throw in 'do' block.下面的图片给你更多的想法.
为什么是这样.我不知道.怎么解决这个问题.希望你的帮助.
| 归档时间: |
|
| 查看次数: |
7171 次 |
| 最近记录: |