Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertView cancelButtonTitle

Is there a way to set title to the cancel button for UIAlertView apart from its constructor initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:. In case I have initialized the UIAlertView previously and at later point I want to change the cancel button's title.

like image 442
user682765 Avatar asked Apr 16 '12 03:04

user682765


1 Answers

I don't know about changing the cancel button text at a later point (I don't see any remove/edit button methods), but if you don't specify a cancel button up front, you can add it later, with whatever label you want, e.g.

[action setCancelButtonIndex:[action addButtonWithTitle:@"Cancel"]];
like image 180
Rob Avatar answered Nov 08 '22 23:11

Rob