UIAlertView在应用加载时显示,打开

时间:2011-01-19 12:52:56

标签: iphone xcode uialertview

如何在应用打开时显示提醒视图,加载...

就像每次用户打开应用程序一样,他会看到警报......

3 个答案:

答案 0 :(得分:1)

在以下appDelegate方法中编写alert语句,

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
      UIAlertView *alert_View = [[[UIAlertView alloc] initWithTitle:@"Your Title" message:@"Your Message" delegate:self cancelButtonTitle:nil otherButtonTitles:@"YES",@"NO",nil] autorelease];
    [alert_View show];
}

答案 1 :(得分:0)

applicationDidFinishLaunching:和applicationWillEnterForeground中的应用程序委托类中显示alertview:

答案 2 :(得分:0)

@Rafeel将此UIAlertView放入AppDelegate的didFinishLaunchingWithOptions方法中,当您的应用启动时,您将始终获得UIAlertView

UIAlertView *confirmAlertView=[[UIAlertView alloc]initWithTitle:@"Saved" message:@"Want to save!!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil];
    [confirmAlertView show];
    [confirmAlertView release];

希望它会帮助你!