2010-07-12 101 views

回答

4

你想要UIAlertView类。例如:

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]; 
+0

天才。谢谢!!!!! – user377419 2010-07-12 17:37:02

+3

如果您不熟悉所有Cocoa Touch UI元素,我建议您抓取Apple示例项目“UICatalog”http://developer.apple.com/iphone/library/samplecode/UICatalog/Introduction/Intro.html – 2010-07-12 17:41:44

0

使用Interface Builder创建一个NS Window。在你的appdelegate中,打开窗口。

+0

但我希望它看起来像这样.. http://artoftheiphone.com/wp-content/uploads/FTP/GPush5.jpg 我可以这样做吗? – user377419 2010-07-12 17:17:37

+0

mcandre:阅读问题和标签。 Cocoa Touch是指iOS上的Cocoa框架,而不是Mac上的。 NSWindow在任何情况下都不会是合适的课程。 – 2010-07-12 17:35:35

0

另一种选择是CFUserNotification。 UIAlertView的优点是它不要求你链接到UIKit。