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
.
精彩评论