title: CoreData: search for entries with relationship to another entrie
body: <p>Since I don't know how to describe my problem exactly I did not find any suitable answer. I hope I can explain it right :)</p>
  
  <p>I have three entities: Player, Event and EventPlayerState. The EventPlayerState has a n-1 connection to the Player and Event and some additional attributes.</p>
  
  <p>For one function, I need all EventPlayerStates with connection to the event X. I have the object of the event X, but I  don't know how to search in CoreData with an object.</p>
  
  <p>The same with code:</p>
  
  <pre><code>NSMutableArray *eventplayerstates = [fetched results] NSMutableArray
  *selectedObjects = [[NSMutableArray alloc] init];
  
  for(int i = 0; i &lt; [eventplayerstates count]; i++) 
  {    
     if([eventplayerstates[i].hasEvent objectID] == [event objectID])
     {
        [selectedObject addObject:eventplayerstates[i]];    
     } 
  }
  </code></pre>