Reputation: 17591
In my app I have two entity in this way:
So, I've two questions:
1- when I delete a "First" entity I want to delete all entity "Characteristics" that belong to first. Do I set the delete rule "Cascade"?
2- If I delete a "characteristics" object from figure, with the method
- (void)removeCharacteristicsObject:(Characteristics *)value;
I want to delete also the characteristics identity, not only from figure, what's the way to do it?
thanks
Upvotes: 1
Views: 1777
Reputation: 77661
Correct. Set the delete rule for figure -> characteristic
to Cascade. This will delete all the characteristics associated with a figure when you delete the figure.
You don't even need to remove the characteristic. Just delete the characteristic and it will remove it from the figure. You could remove it and then delete it but easier just to delete it. Set the delete rule for characteristic -> figure
to Nullify.
Upvotes: 2