UIAlertView cancelButtonTitle

ios, objective-c, uialertview

Solution

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"]];

Problem

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.

Original source