iphone - Core Data Ordered Join Table Efficiencies -


I have a complex core data mapping, which is simplified here in this picture for relevant questions in this picture:

My question is,

  1. Get a list of all categories, which are sorted by name
  2. For each category, collect the sorted fuses, sorted by ascending index
  3. For each sorted foo, bring the associated foo, stick in the array
  4. Take a fuse, Now sorted by an index in an array, and this array is added to the 2D array
  5. Return the 2D array as the ordered foo in each alphabetized category. It seems that Soooooo should definitely be a better way to make this normal type of fit to disable me. Can someone recommend a new way of doing this?

I will make the foo sort index universal in all categories. After that, sort all foo objects by index.

If you were using the result controller with any result, you would use that category name as the path to the section name. If not, you can divide them by category name only.

UPDATE
In fact, the way you have the index, you can bring all the foo objects and sort them first by category and then by the Sortfuos index .

Update 2
For example:

  NSSortDescriptor * sortDescriptor = [[NSSortDescriptor alloc] initWithKey: @ "sorted_positions.category. Name "climb: yes]; NSSortDescriptor * sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey: @ "sorted_positions.index" ascending: yes]; NSArray * sortDescriptors = [[NSArray alloc] initWithObjects: sortDescriptor, SortDescriptor 2, Zero]; [FetchRequest SetSearch synthesizer: Sort descriptor];  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -