I have an array of objects _schedule.games I want to display the Game property opponent in each game as I loop through the schedule.
int x = 0;
for (int i = 0; i < [_schedule.games count]; i++)
{
Game *game = [_schedule.games objectAtIndex:i];
game.opponent = ((Game *) [_schedule.games objectAtIndex:i]).opponent;
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, 0, 100, 100)];
[button setTitle:[NSString stringWithFormat:@"%@", game.opponent] forState:UIControlStateNormal];
[_gameScrollList addSubview:button];
x += button.frame.size.width;
}
game.opponent = ((Game *) [_schedule.games objectAtIndex:i]).opponent;if you can directly access game .opponent