title: How to get core data distinct values with relationship values?
body: <p>I am trying to get all the distinct Identity values (contact has many identities). I am also trying to get the contact.sectionIndex from the contact model. I am trying the code below and get "returned nil value for section name key path 'Contact.sectionIndex'" for each record. </p>
  
  <pre><code>NSFetchRequest *req = NSFetchRequestMake(@"Identity", managedObjectContext);
  req.fetchBatchSize = 20;
  req.sortDescriptors = NSSortDescriptors1(@"sortname", YES);
  [req setResultType:NSDictionaryResultType];
  [req setReturnsDistinctResults:YES];
  [req setPropertiesToFetch:@[@"identityID", @"sortname"]];
  
  
  // Create &amp; return the fetchedResultsController.
  fetchedResultsController = [[NSFetchedResultsController alloc]
                              initWithFetchRequest:fetchRequest
                              managedObjectContext:managedObjectContext
                              sectionNameKeyPath:@"contact.sectionIndex" cacheName:nil];
  [VenmoUtilities performFetch:fetchedResultsController critical:NO];
  </code></pre>