如何更改UIAlertView取消按钮文本

时间:2010-10-14 23:17:35

标签: iphone cocoa-touch

我想知道如何在运行时更改UIAlert的取消按钮文本。

1 个答案:

答案 0 :(得分:5)

- (void)showAlertWithTitle:(NSString*)title message:(NSString*)message cancelButtonTitle:(NSString*)cancelTitle {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:cancelTitle otherButtonTitles:nil];
    [alertView show]
    [alertView release];
}