2012-04-12 7 views
0

나는 이것을 정해진 시간에 경고하기 위해했다. 하지만 시간이 지나면 알려주지 않습니다. datepicker에서 시간을 설정하고 있습니다. 어떻게이 문제를 해결할 수 있습니까?설정 시간에 경고 메시지가 표시되지 않습니까?

- (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]; 
} 

또한 내가 설정 한 시간과 날짜 나 경고를 받고 있지 않다

[self scheduleNotificationWithInterval:1]; 

후 버튼을 클릭하여이 메서드를 호출. 내가 할 수있는 것?

+0

datePicker.date 문자열의 날짜 형식을 확인하십시오. – Charan

+0

설정 한 발사 시간을 로그에 기록하십시오. –

답변

1

올바른 시간대를 설정 하시겠습니까? 문제가 거기에있을 수 있습니다.

설정하지 않으셨습니까?

0

나는 대부분 당신의 의심이이 링크를 해결한다고 생각합니다. Local Notifications with iOS 4. 그것은 분명히 통해 UR 문제를 해결할 수 있습니다.

관련 문제