开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜