title: Objective C - Check if object in array is a dictionary key
body: <p>I am trying to set an image according to the value of the key in the dictionary. So I am not writing a bunch of if-else's I am trying to see if I can loop through the values in the array and see if it equals the key in the dictionary.</p>
  
  <p>I have a dictionary: </p>
  
  <pre><code>    NSDictionary *dict=[gamesArray objectAtIndex:indexPath.row];
      [cell.infTeam1 setText:[dict objectForKey:HOME_TEAM_NAME]];
      [cell.infTeam2 setText:[dict objectForKey:AWAY_TEAM_NAME]];
      NSArray *teams = [[NSArray alloc]initWithObjects:@"Bucks",nil];
  
      for (NSString *team in teams) {
          if ([team isEqualToString:dict[@"homeTeamName"]]) {
              // add image
          }
      }
  </code></pre>
  
  <p>But I'm getting a Thread 1: EXC_BAD_ACCESS error on my teams array. Any help is appreciated.</p>