UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"open app" message:@" backgr..." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
如果应用运行背景,我怎么能显示警告?
答案 0 :(得分:4)
当您的应用在后台时使用UILocalNotification
。
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"Your message";
notification.alertAction = @"Open app";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];