title: Core Data: Using Predicates with to-many Relationship
body: <p>To-Many relationship in Entity "Meetings" &lt;--->> "Users"</p>
  
  <p>I made a NSManagedSubclass for "Meetings" and it has a property:</p>
  
  <pre><code>@property (nonatomic, retain) NSSet *users;
  </code></pre>
  
  <p>Objects in *users save fine and I can see them.  But when I try to fetch, nothing happens.    I have the breakpoint setup inside the Block and it seems like the fetch Block never reaches the breakpoint.  No errors.  Applications is still running.  </p>
  
  <p>I have the following code:</p>
  
  <pre><code>        NSString *userName = @"iphone";
          NSLog(@"Username %@", userName);
  
          NSFetchRequest *request = [[NSFetchRequest alloc] initWithEntityName:@"Meeting"];
          NSPredicate *predicate = [NSPredicate predicateWithFormat:@"users.username == %@", userName];
          NSLog(@"Predicate %@", predicate);
          [request setPredicate:predicate];
  
          [self.managedObjectContext executeFetchRequest:request onSuccess:^(NSArray *results)
           { // I have setup the breakpoint here 
               NSLog(@"results.count %i", results.count);
  
               if(results.count &gt; 0)
               {
                   NSLog(@"object found");
               }
           }onFailure:^(NSError *error) {
                    NSLog(@"There was an error! %@", error);
           }];
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>2013-10-12 20:10:19.200 App[3128:c07] Username iphone
  2013-10-12 20:10:19.200 App[3128:c07] Predicate users.username == "iphone"
  </code></pre>
  
  <p>I can fetch for other attributes in Meetings just fine.  i.e.  If I replace the predicate line with :</p>
  
  <pre><code>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"meetings_id == %@", meetings_id];
  </code></pre>
  
  <p>And the breakpoint will stop the code, the will show "object found".</p>
  
  <p>Again, I can see the "iphone" user inside the users relationship.  What am I doing wrong?</p>