Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertView without Cancel Button?

I am trying to create a UIAlertView that has 3 options and no "cancel" button, but when I do this, it always styles "Button 3" as a cancel button. Is there any way to avoid this?

UIAlertView *alertView= [[UIAlertView alloc] initWithTitle:@"Select One" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:@"Button 1",@"Button 2", @"Button3", nil];
like image 209
Chris Avatar asked Aug 30 '11 22:08

Chris


1 Answers

I did differently, passing cancelButtonTitle argument as nil.

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title"
                           message:@"Message here"
                           delegate:self
                           cancelButtonTitle:nil
                           otherButtonTitles:@"OK", nil];
like image 82
Wédney Yuri Avatar answered Nov 03 '22 01:11

Wédney Yuri