Cocoa Touch - Dialogue boxes?
How can i get a plain basic dialogue box in cocoa touch.se开发者_运维知识库ems so simple but I can figure it out...
Thanks!
You want the UIAlertView class. For example:
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Something happened"
message:@"And here is some more information about what it is."
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[myAlert show];
[myAlert release];
Create an NS Window
using the Interface Builder. In your appdelegate, open the window.
Another option is CFUserNotification. The advantage to UIAlertView is that it does not require you to link against UIKit.
精彩评论