title: Fetching one to many relationship data with Core Data
body: <p>I have a Core Data model with an entity called <em>SeasonInfo</em> that contains a bunch of attributes, one of which is an attribute called <em>year</em> (int 16).  <em>SeasonInfo</em> contains a one-to-many relationship to an entity called <em>GameInfo</em> (the relationship name defined in SeasonInfo is called <em>games</em>). </p>
  
  <p>My populated database contains a bunch of seasons (one for every year)... then each season has a list of games - a bunch of games for each season.  <em>SeasonInfo</em> &lt;---->> <em>GameInfo</em></p>
  
  <p>In my TableView contoller I use the following to access the <em>SeasonInfo</em> for a given year :</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription
                                 entityForName:@"SeasonInfo"      inManagedObjectContext:managedObjectContext];
  [fetchRequest setEntity:entity];
  
  // Set up the cell...
  SeasonInfo *info = [seasonInfoArray objectAtIndex:indexPath.row];
  
  //Put the Year as the Main title of the Row
  yearLabel.text =[NSString stringWithFormat: @"%@",   info.year];
  </code></pre>
  
  <p>That seems to work great... but now I can't figure out how to access the games for a specific season.  From this table view, when I select a specific year, I'd like to pass an NSArray of games to another Table View controller... I know how to pass data between views, I just can't figure out how to populate the "gamesArray" before I transition to the Schedule View.</p>