I have a 1-to-many relationship in a Core Data graph, and I'm trying to understand the difference between using a CoreDataGeneratedAccessors method and a simple assignment to alter a relationship. For example, the Core Data Programming Guide has a department and employee example. In that example they use the CoreDataGeneratedAccessors to hire and fire employees:
[aDepartment addEmployeesObject:newEmployee];
[aDepartment removeEmployeesObject:firedEmployee];
They don't define an inverse relationship, but say "department" is the inverse relationship to "employees". Should the following then accomplish the same thing?
newEmployee.department = aDepartment
firedEmployee.department = nil;
According to the Manipulating Relationships and Object Graph Integrity section of the Core Data Programming Guide, the later examples should automatically fix all relationships to maintain graph consistency. If that's the case, is there any reason to use the CoreDataGeneratedAccessors when an inverse relationship exists? Does using the CoreDataGeneratedAccessors maintain graph consistency on inverse relationships?