Core Data Question: Deleting managed objects deletes subclasses?
If I have a Person class with a 'one to many' relationship with a Tasks class, does deleting the person also delete the tasks?
Thanks in advance for the help.
Posted Sep 12, 2015, 9:25 AM UTC
12
There's a thing called "Delete Rule" for entities' relationships.
In your situation, I believe you want "cascade" on User's "tasks" relationship and "nullify" (or probably "do nothing") for Task's "user" relationship.
Cascade means that the related objects will be deleted along with deletable object, so user's tasks will be deleted too if user is deleted.
And if task is deleted - nothing happens to the user.
Thank you, eimantas! I look into the documentation for more on Cascading.
Upvotes for you!