ios - How to use entity relationship to get count difference of arrays -


Suppose I have a data model with the organization department and role with relationship; Department & lt; - & gt; & Gt; Role . In my UI, I currently display the Department 1 and other departments in the Table Display list (eg, Department 2, Department 3 ...).

I'm trying to get a bunch of arrays: each per role can find an array of role division 1 shown me in every department, which can get Fekrikakvist and Wardiket but Can not find out how the array of roles for each department in the tableview can be found. Any help is greatly appreciated!

First of all, you do not need Arejh core data NSFetchedResultsController by It is managed - this table works best with the view Also, most likely you will not need any fetch requests.

To get all the roles in a department, please call your relationship Name:

  department1.roles   

The result is a NSSet that has not been ordered. You can order it, e.g.

  department1.roles.sortedArrayUsingSortDescriptors ([NSSortDescriptor (Key: "Name" ascending: true)])   

Table If you want to display it roles of sections and rows in sections, you NSFetchedResultsController to role code> sectionNameKeyPath specified; E.g. Name).

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -