开发者

How to send an alert

How 开发者_如何学Cdo you code an alert message in objective c. Xcode if the user chooses the wrong color in the application.


The Apple Documentation is a wonderful thing :-)


You will want to use the UIAlertView class. Here's an example:

UIAlertView *alert = [[UIAlertView alloc]
                      initWithTitle: @"Wrong Color"
                      message: @"You chose the wrong color."
                      delegate: nil
                      cancelButtonTitle:@"OK"
                      otherButtonTitles:nil];
[alert show];
[alert release];


Here is an example:

UIAlertView *alert = [[UIAlertView alloc]
            initWithTitle: @"Announcement"
            message: @"You chose the wrong color!"
            delegate: nil
            cancelButtonTitle:@"OK"
            otherButtonTitles:nil];
[alert show];
[alert release];


It sounds like you're looking for UIAlertView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜