-(void)mybuttonclick{
UGFloat p=120;
for(int i=0;i<3;i++){
UIButton *aa = [UIButton buttonWithType:UIButtonTypeCustom];
if(i==0){
You aren't telling the button about name
anywhere. You could set it in the title buttons title with [aa setTitle:name forState:UIControlStateNormal];
then access it in fullscreen:
with [sender currentTitle]
.
If you want the message to be independent of the title you could either make your own subclass of UIButton
to store the message or have a different target action for each button.
Also, the way you are constructing the names is fragile. Something like this might be better:
NSArray* names = [NSArray arrayWithObjects:@"ZERO",
@"ONE",
@"Two",
@"Three",
nil];
for (NSString* name in names) {
// Do stuff with name
}