나는 이것을 정해진 시간에 경고하기 위해했다. 하지만 시간이 지나면 알려주지 않습니다. 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];
후 버튼을 클릭하여이 메서드를 호출. 내가 할 수있는 것?
datePicker.date 문자열의 날짜 형식을 확인하십시오. – Charan
설정 한 발사 시간을 로그에 기록하십시오. –