title: Perform sorting between two entities
body: <p>I have an entity <code>EventScheduleOnc</code> with an attribute <code>eventNameOnc</code> with one-to-one relationship with <code>EventDec</code> entity with an attribute <code>eventStatus</code>. I am trying to perform sort like this</p>
  
  <pre><code> var fetchedResultsController: NSFetchedResultsController = { () -&gt; NSFetchedResultsController&lt;NSFetchRequestResult&gt; in 
  
      let eventsOncFetchRequest = NSFetchRequest&lt;NSFetchRequestResult&gt;(entityName:"EventScheduleOnc")
      let primarySortDescriptor = NSSortDescriptor(key:"EventDec.eventStatus", ascending: true)
      let secondarySortDescriptor = NSSortDescriptor(key:"eventNameOnc", ascending: true)
      eventsOncFetchRequest.sortDescriptors = [primarySortDescriptor,secondarySortDescriptor]
  
      let frc = NSFetchedResultsController(fetchRequest: eventsOncFetchRequest, managedObjectContext:context,
                                           sectionNameKeyPath:"EventDec.eventStatus",cacheName: nil)
      frc.delegate = self
  
      return frc}()
  </code></pre>
  
  <p>I am getting this error</p>
  
  <blockquote>
    <p>*** Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: 'keypath EventDec.eventStatus
    not found in entity '</p>
  </blockquote>