title: Performing the equivalent of a union with Core Data for a UITableViewController
body: <p>I know union is a <code>SQL</code> construct, but it's the best analogue for what I'm trying to do.</p>
  
  <p>I have multiple groups of data that I'm receiving from an external source. I'm maintaining them as separate entities in Core Data (they only have some attributes in common (e.g. name)), but I want to present them in the same <code>tableView</code>.</p>
  
  <p>Say I have an entity Food that has relationships with FruitGroup and VegetableGroup. The FruitGroup has a relationship with Fruit which has a relationship with FruitType. The VegetableGroup is similar.</p>
  
  <p>How can I use FruitGroup.Fruit.name <strong>and</strong> VegetableGroup.Vegetable.name as sectionTitles?  And FruitGroup.Fruit.FruitType.name <strong>and</strong> VegetableGroup.Vegetable.VegetableType.name for row data. (I tried coming up with a predicate that walks down from Food, but that doesn't appear to be workable)</p>
  
  <p>Example modeled data (my groups are far more disparate than fruits and veggies, so re-doing my data model is not an option):</p>
  
  <pre><code>Food
    FruitGroup
       Apple
           Macintosh
           Granny Smith
       Pear
           Bartlett
           Asian
           Anjou
    VegetableGroup
       Asparagus
           white
           wild
       Peas
           baby
           split
  </code></pre>
  
  <p>Which I would like to appear as:</p>
  
  <pre><code>Apple [section]
     Macintosh   [row]
     Granny Smith
  Pear
     Bartlett
     Asian
     Anjou
  Asparagus
     white
     wild
  Peas
     baby
     split
  </code></pre>
  
  <p>I could use multiple <code>NSFetchedResultsControllers</code> in the <code>UITableViewController</code> and conditionally select the FRC within each of the <code>UITableViewDataSource</code> methods, but that doesn't feel clean.</p>
  
  <p>I'm thinking about subclassing <code>NSFetchedResultsController</code> and, internal to my subclass, merging the results of multiple private <code>NSFetchedResultsControllers</code> that each represent one of the entities.  (e.g. sections returns a concatenation of the returns from the sections calls of the internal FRCs)  </p>
  
  <p>Does this make sense - or is there a better way? (I saw <a href="https://stackoverflow.com/questions/16273098/core-data-union-query-equivalent">Core Data Union Query Equivalent</a> but since there are relationships among my entities, I wanted to seek alternatives)</p>