Core Data - Delete Object with Dependency
Hey Team,
Lets say I have two entities. Department and Employees. An employee can belong to many departments and a department can have many employees. If an employee belongs to a department, I don't want them to be deleted.
I have the code to delete an employee.
I have the delete rule set to Deny in Core Data
I already have the alert message ready.
All I basically need is the snippet that knows what to look for so I can say to the user, you cant delete that record b/c it belongs to a department.
Thanks
|