目标C:IBaction中的UIAlert

时间:2011-04-07 09:47:02

标签: objective-c xcode uialertview ibaction

当我按下按钮时,我会在IBAction中插入UIAlert,我该怎么办?这个UIAlert必须显示消息“Done”和一个关闭它的按钮。

1 个答案:

答案 0 :(得分:4)

- (IBAction)onShowAlertView 
{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"done" 
                                                        message:@"" 
                                                       delegate:nil 
                                              cancelButtonTitle:@"close" 
                                              otherButtonTitles:nil];
    [alertView show];
    [alertView release];
}