Ich tat dies um auf die eingestellte Zeit aufmerksam zu werden. Aber es warnt nicht pünktlich. Ich setze Zeit vom Datepicker. Wie kann ich dieses Problem lösen?UILocalnotification wird zur eingestellten Zeit nicht alarmiert?
- (void)scheduleNotificationWithInterval:(int)minutesBefore {
[[UIApplication sharedApplication] cancelAllLocalNotifications];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
NSLog(@"Date %@",datePicker.date);
localNotif.fireDate = datePicker.date;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
if ([freq isEqualToString:@"Daily"]) {
localNotif.repeatInterval = NSDayCalendarUnit;
}
localNotif.alertBody = @"Radio Asia Alarm";
localNotif.alertAction = @"Ok";
localNotif.soundName = UILocalNotificationDefaultSoundName;
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"Radio Asia Alarm" forKey:@"Message"];
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
}
Auch nenne ich diese Methode, wo ich Taste nach der eingestellten Zeit klicken und Datum
[self scheduleNotificationWithInterval:1];
Ich bin nicht auf die Warnung bekommen. Was ich tun kann?
Überprüfen Sie das Datumsformat von datePicker.date string – Charan
Versuchen Sie, firteate zu protokollieren, nachdem Sie es festgelegt haben –