Apple's documentation of Relationship Delete Rules is simple and clear. But it only talks about One-to-Many relationship(Delete Rules for One-to-One relationship are easy to infer). It's not clear what these rules mean for Many-to-One relationship. So let's clarify them here.
We use the Employees-Department example used in Apple's documentation. Though the real-life implications may be ridiculous of these rules applying to Employees-Department relationship, we, as programmers, are only talking about their logic implications here.
Deny
If there is an object at the relationship destination, then the source object cannot be deleted.For example, if you want to deleted an employee, no matter whether there are still other employees in his department, you must ensure that the department is first deleted otherwise the employee cannot be deleted.
Nullify
Remove the source object from the inverse relationship of the object at the destination. (See @bshirley's concise explanation)For example, if you delete an employee, remove him from employees relationship of his department. This only makes sense if the number of remaining employees of the department is larger than the minimum count required, or if you ensure that you add new employees for the department before the next save operation.
[Question: If it is the last employee, will the department's employees relationship become empty set or null?]
(Answered by @TechZen: A to-many relationship always returns a set object. It is never nil. If there are not objects on the other side of the relationship, the set is empty.)Cascade Delete the object at the destination of the relationshi