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.