
In my iphone SDK program.. i wanted to create multiple UIButton programatically. I know how to create button and i have already created and added it to my view. But that is only one ..and i requirement is to create multiple UIButton's according to number of items available into database.
Any help is appreciated. Thanks in Advance!

iPhone SDK Creating a UIButton
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMake(0, 0, 150, 190); [self.view addSubview:myButton];
iPhone SDK Creating Multiple UIButton
for (int row = 0; row<4; row++){
for (int col = 0; col<13;col++) {
offset +=1;
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
aButton.frame = CGRectMake(5+col*65+offset,5+row*65, 60, 60);
[aButton setTitle:myarray[row][col] forState:UIControlStateNormal];
[aButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[keyboardView addSubview: aButton];
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.