I have two questions about using Core Data. As an example, consider a typical Employee and Department case. The employee has a relationship field of "deparment" to one-one to Department, and the unit has a relationship of "employee" as many for the Employee person.
I would like to display all the employees in TableView in the department name sections. I think the NSFetchedResultsController should use Employee as an entity. I am not sure how to use the department name as a sorting criterion, since it is in the field field of the employee relations department. Can you use "DepartmentName" as a sort and add this to the Employee entity class as a method that will return the department name for this employee?
The second question is the name of the section. I would like to use department names as partitions. Can I use the above method as the sectionKeyPath value for NSFethedResultsController?
Not sure I'm on the right track.
source
share