Цикл кода для создания кнопок
UIButton *yourButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[yourButton setFrame:CGRectMake(x, y, 50, 50)];
[yourButton setTitle:@"Click Here" forState:UIControlStateNormal];
[yourButton addTarget:self action:@selector(yourAction:) forControlEvents:UIControlEventTouchUpInside];
yourButton.tag = tag;
[self.view addSubview:yourButton];
//increment x or y as per your need,
Действие что-то вроде
- (IBAction) yourAction : (UIButton *) sender
{
NSLog(@"I'm %d pressed.",sender.tag);
}