문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top