I am attempting to programmatically add buttons to my screen while looping through an array. The code I've posted below works just fine in the simulator (and executes without error on the phone), however, the button is not added to the screen on the phone. Any suggestions as to where I've gone wrong?
// loop through missions, dropping buttons
UIButton *button;
for(mission in activeMissions){
// add a button for the mission
buttonImage = [UIImage imageNamed:@"missionIconAttack.png"];
button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0,0, buttonImage.size.width, buttonImage.size.height);
button.center = CGPointMake(60, 298); // hard coded for simplicity
button.tag = [missionButtons count];
[button setImage:buttonImage forState:UIControlStateNormal];
[button addTarget:self action:@selector(SelectMission:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
[missionButtons addObject:button];
[button release];
button = nil;
}