当应用程序在后台运行时显示UIAlert?

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"open app" message:@" backgr..." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; 

应用程序运行后台时,如何显示警报?

当你的应用程序在后台时使用UILocalNotification

 UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.alertBody = @"Your message"; notification.alertAction = @"Open app"; [[UIApplication sharedApplication] presentLocalNotificationNow:notification];