title: Core Data, try to use NSPredicate to filter a toMany relationship set but get the "to-many key not allowed here" error
body: <p>Here is the model I have:
  <a href="http://www.girardet.ch/model.png" rel="noreferrer">http://www.girardet.ch/model.png</a></p>
  
  <p>My goal is to retrieve all the Quotes with these criterias:</p>
  
  <ul>
  <li>belong to a specific theme : the name_en attribute of Themes</li>
  <li>order by relevancy</li>
  <li>filtered by Authors (with the alias attribute of Authors)</li>
  </ul>
  
  <p>Here is my code:</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription entityForName:@"ThemeEntries" inManagedObjectContext:_context];
  [fetchRequest setEntity:entity];
  
  NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"relevancy" ascending:NO];
  NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor1, nil];
  [fetchRequest setSortDescriptors:sortDescriptors];
  
  // predictate - filter
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"theme.name_en=%@ AND quotes.author.alias=%@",@"mytheme", @"myauthor"];
  </code></pre>
  
  <p>[fetchRequest setPredicate:predicate];</p>
  
  <p>I get the "to-many key not allowed here" error.</p>
  
  <p>If I instead use this predicate</p>
  
  <pre><code>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"theme.name_en=%@, @"mytheme"];
  </code></pre>
  
  <p>it works well and I can loop over the <code>ThemeEntries</code> that I get and get all my quotes... But it's not filtered by authors.</p>
  
  <p>What can I do to filter by Authors?</p>