【发布时间】:2016-11-23 02:40:57
【问题描述】:
我试图从核心数据中删除和反对,我在 try catch 中尝试了它,如下所示。
do {
try self.managedContext.deleteObject(self.productList[indexPath.row])
} catch let error as NSError {
print("something wrong with the delete : \(error.userInfo)")
}
上面写着'no calls to throwing functions occur within 'try' expression 和'catch block is unreachable because no errors are throw in 'do' block。下图给你更多的想法。
这是为什么。我不知道。如何解决这个问题。希望您的帮助。
【问题讨论】:
-
错误信息告诉你所有你需要知道的...
标签: ios core-data swift3 try-catch warnings