2012-04-12 13 views
0

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?

+0

Überprüfen Sie das Datumsformat von datePicker.date string – Charan

+0

Versuchen Sie, firteate zu protokollieren, nachdem Sie es festgelegt haben –

Antwort

1

Sind Sie sicher, dass Sie die richtige Zeitzone einstellen? Ich bin sicher, dass das Problem dort sein könnte

Haben Sie versucht, ohne es zu setzen?

Verwandte Themen