I also tried changing the method of deletion to the following. This tries to delete entity Object that has a to-many relationship children: [Child]. guard let id = object.id else { return } do { try container.mainContext.delete(model: Object.self, where: #Predicate { object in object.id == id }) } catch { print(error) } This does not crash the app, but fails to delete the entity with the following console output: Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={Reason=Entity named:Object not found for relationship named:children, MissingEntity=Object. () ... I'm not sure what this means, perhaps someone more clever will find it useful. @DTS Engineer
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: