title: "multiple to-many keys not allowed here" issue with a predicate
body: <p>I need some help with a predicate for a <code>NSFetchedResultsController</code>. My guess is that can be done with a <code>SUBQUERY</code> but I can not figure out how.</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Album"];
  fetchRequest.predicate = [NSPredicate predicateWithFormat:@"ANY tracks.playlistItems.playlist == %@", section.playlist];
  </code></pre>
  
  <p>When executing a fetch request with this predicate I get a “multiple to-many keys not allowed here” error. Which makes sense since album has multiple tracks, and a track has multiple playlist items. </p>
  
  <p>So using natural language here is what I want from this predicate: an album where at least one of its tracks has at least one of its playlistItems that has the following playlist.  </p>
  
  <p>Can I achieve this using a SUBQUERY in my predicate?</p>
  
  <p><em>(I know that this can be easily achieved using 2 fetch requests, but I was wondering if this can be done using one request, since I am using a <code>NSFetchedResultsController</code>)</em></p>