In my app i have two entity:
Multiple 'Activities' has records inside. When i delete the last ActivityRecord entity in the Activities, i want to delete also Activities entity. I did 'nullify' the delete rule of whichDate but Activities not deleted.
Result is here:
If you want to delete an Activities
when it has no more ActivityRecord
s then... you have to delete the Activities
. There is no way to automate this in Core Data. If you don't want to have any Activities
objects with no related ActivityRecord
s, then you need to write your own code that deletes them.
When you're going to delete an ActivityRecord
, you need to check the related Activities
. If it doesn't have any more activity records, delete it too.