title: Showing duplicate cells in UITableView via NSFetchedResultsController?
body: <p>I am querying Core Data to find the "OLDEST" and "HEAVIEST" amongst a group of people. With a larger dataset this usually works (as the chance of a duplicate match is less), but with a small dataset where the OLDEST person may also be the HEAVIEST I am having problems.</p>
  
  <pre><code>[John, 77, 160]
  [Pete, 56, 155]
  [Jane, 19, 130]
  [Fred, 27, 159]
  [Jill, 32, 128]
  </code></pre>
  
  <p>As I want to display this information in 2 <code>UITableViewCell</code>s of a <code>UITableView</code> I am doing this by first running 2 <code>NSFetchRequests</code> (one to find the OLDEST, the second to find the HEAVIEST) I am them taking the <code>objectID</code>s for each managed object and adding them to a final <code>NSFetchRequest</code> that I am using to setup my <code>NSFetchedResultsController</code>. </p>
  
  <pre><code>// FETCH REQUEST - OLDEST, HEAVIEST
  NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"People"];
  NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"age" ascending:YES];
  [fetchRequest setSortDescriptors:[NSArray arrayWithObject:descriptor]];
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF IN %@", IDArray];
  [fetchRequest setPredicate:predicate];
  </code></pre>
  
  <p>If I "Print the Description" of the final <code>NSFetchRequest</code> it does indeed contain 2 pointers to managedObjects.</p>
  
  <pre><code>(i.e. [John, 77, 160] [John, 77, 160])
  </code></pre>
  
  <p>My problem seems to be that when I do </p>
  
  <pre><code>[[self fetchedResultsController] performFetch:nil];
  </code></pre>
  
  <p>the <code>UITableView</code> delegate method:</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      NSArray *sectionArray = [[self fetchedResultsController] sections];
      id &lt;NSFetchedResultsSectionInfo&gt; sectionInfo = [sectionArray objectAtIndex:0];
      NSUInteger numberOfRows = [sectionInfo numberOfObjects];
      NSLog(@"ROWS: %u", numberOfRows);
      return numberOfRows;
  }
  </code></pre>
  
  <p>only shows the <code>numberOfRows</code> as 1 and only displays a single [John, 77, 160] in my <code>UITableView</code>.</p>