How about something like this? It's not perfect so you'll have to play with it but it should get you started in the right direction...
in your .h
IBOutlet UIButton *firstButton, *secondButton, *thirdButton, *fourthButton
NSArray *buttonsArray;
in your .m
-(void)viewDidLoad{
// VDL stuff
buttonsArray = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", @"Five", @"Six", nil];
[firstButton setTitle:[buttonsArray objectAtIndex:0]];
[firstButton setTag:0];
// initial setup of the other three buttons works the same way
}
-(IBAction)updateButtons:(id)sender{
UIButton *btn = (UIButton*)sender;
int index = btn.tag;
for(int i = 0; i <4; i++){
if([buttonsArray count] > index+i){
switch(i){
case 0:;
[firstButton setTitle:[buttonsArray objectAtIndex:i+index]];
[firstButton setTag:i+index];
break;
case 1:; //secondButton
break;
case 2:; //thirdButton
break;
case 3:; //fourthButton
break;
}
}else{
break;
}
}
}
Then all you need to do is connect the four on-screen buttons to the action and in the else you'll need some logic (pretty much the same as the switch-case above) to hide ones once you get towards the end of the array if that's what you want to do.