views:

45

answers:

2

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?

Thanks.

A: 

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.

TechZen
A: 

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.

chance
Thanks for this clarifying comment.
ed94133