I’m facing that problem I’ve got 2 managed object subclasses connected by a “one-to-many” relationship. When I delete the parent I’d like to do some operations for each one of the children objects before it starts to delete all of them.
I know that I can do a custom delete for the parent object that does those operations before, but I’m wondering if exists some kind of notification or validation send before the deleting starts also for children objects.
What is the best approach?
I’m facing that problem I’ve got 2 managed object subclasses connected by a one-to-many
Share
It’s quite simple: just implement
prepareForDeletionin yourNSManagedObjectsubclass.Alternative is to use:
For more info, Apple documentation is the way.