我正在使用 UILocalNotification 来安排 UIAlertView,效果很好。但是,在 iOS 6(可能是 iOS 5)中,通知会在 5 或 6 秒后消失。有什么办法可以防止通知消失吗?
...
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [datePicker date];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Blabla?";
notif.alertAction = @"Show me";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.hasAction = true;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
...
- (void)showReminder:(NSString *)text {
alert = [[UIAlertView alloc] initWithTitle:@"Blabla?"
message:text delegate:self
cancelButtonTitle:@"YES"
otherButtonTitles:nil];
[alert show];
[alert release];
}
谢谢!