Pergunta

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?

Foi útil?

Solução

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.

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top