title: CoreData - NSPredicate with NSSet
body: <p>I have a DB with the following relationships:</p>
  
  <p><img src="https://i.stack.imgur.com/bV4Od.png" alt="enter image description here"></p>
  
  <p>A &lt;&lt;-->> B</p>
  
  <p>A: Members table; B: Activities table</p>
  
  <p>A Member has many Activities, and each Activity has many Members. So, a many to many relationship.</p>
  
  <p>When the user selects an Activity from a tableView, a new tableView should be pushed with all the Members that has that Activity.</p>
  
  <p>In the NSPredicate of the "child" tableView, I do:</p>
  
  <pre><code>request.entity = [NSEntityDescription entityForName:@"Members" inManagedObjectContext:context];    
  request.predicate = [NSPredicate predicateWithFormat:@"memberActivity = %@", [NSSet setWithObject:activity]];
  </code></pre>
  
  <p>And the result is:</p>
  
  <blockquote>
    <p>*** Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: 'to-many key not allowed here'</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks,</p>
  
  <p>RL</p>