I'm trying to delete an object from core data and I tried it within try catch as below.
do {
try self.managedContext.deleteObject(self.productList[indexPath.row])
} catch let error as NSError {
print("something wrong with the delete : \(error.userInfo)")
}
it say 'no calls to throwing functions occur within 'try' expression
and 'catch block is unreachable because no errors are throw in 'do' block
. following image give you more idea.
why is this. I have no idea. how to solve this. hope your help.
The deleteObject
method doesn't throw. Remove the Do-Catch
block and the warning will go away.