ed94133
ed94133

Reputation: 1575

Quick CoreData -- inverse delete rules

Quick simple question. Apple's CoreData docs explain how delete rules work on a department's employees relationship. Delete a department, and various different things can happen to the associated employees. But what about an employee's department relationship? Should I set my delete rule to No Action, since I don't want the deletion of an employee to have any effect on the department?

Upvotes: 3

Views: 739

Answers (2)

svena
svena

Reputation: 2779

Yes, basically what TechZen said. The point is your own assumption that you don't want deletion of an employee to affect department in any way is misleading since with inverse relationships you would most certainly want department to know they just lost one employee.

Upvotes: 0

TechZen
TechZen

Reputation: 64428

You usually use nullify. That just means the relationship is set to nil. If you use No Action no KVO notification is sent to the other end of the relationship. This can cause problems if objects still think they have a relationship.

Upvotes: 2

Related Questions