views:

52

answers:

3

How can i get a plain basic dialogue box in cocoa touch.seems so simple but I can figure it out...

Thanks!

A: 

Create an NS Window using the Interface Builder. In your appdelegate, open the window.

mcandre
but I want it to look like this..http://artoftheiphone.com/wp-content/uploads/FTP/GPush5.jpgcan i do that?
mcandre: Read the question and the tags. Cocoa Touch refers to the Cocoa frameworks on iOS, not on the Mac. NSWindow wouldn't really be the appropriate class in any case.
Noah Witherspoon
+2  A: 

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];
David Gelhar
Genius. Thanks!!!!!
If you're not familiar with all the Cocoa Touch UI elements, I'd recommend grabbing the Apple Sample project "UICatalog" http://developer.apple.com/iphone/library/samplecode/UICatalog/Introduction/Intro.html
Jay O'Conor
A: 

Another option is CFUserNotification. The advantage to UIAlertView is that it does not require you to link against UIKit.

nszombie