iphone - How to use multiple UIAlertView inside one IBAction with different button? -


is possible show different alerts different buttons in same ibaction based on different conditions?? have code in ibaction:

- (ibaction)btnrecommendationtapped:(id)sender { uialertview *alert = [[uialertview alloc] initwithtitle: @"recommendation"                                                       message: @"it seems interested in %d of collection."                                                      delegate: nil                                             cancelbuttontitle: nil                                             otherbuttontitles: @"yes", @"no", nil]; [alert show]; } 

i have alert shows "sorry! unable provide recommendation" ok button. when condition has fulfilled shows 1 in ibaction otherwise shows one.

-(ibaction)buttonclicked:(id)sender    {           if([sender tag]==0)          {            uialertview *alert = [[uialertview alloc]initwithtitle:@"button 1 clicked" delegate:self              cancelbuttontitle:@"ok" otherbuttontitles:nil, nil];                 [alert show];          }          else if ([sender tag]==1)          {           uialertview *alert = [[uialertview alloc]initwithtitle:@"button 2 clicked" delegate:self            cancelbuttontitle:@"ok" otherbuttontitles:nil, nil];                 [alert show];          }          else if ([sender tag]==2)          {           uialertview *alert = [[uialertview alloc]initwithtitle:@"button 3 clicked" delegate:self            cancelbuttontitle:@"ok" otherbuttontitles:nil, nil];                 [alert show];          } } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -