Я пытаюсь установить повторное напоминание ... Я использую этот код:scheduleLocalNotification следующая дата пожара не работает
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
NSDate* date = [NSDate dateWithTimeIntervalSince1970:[[[task.reminder objectAtIndex:i] valueForKey:@"AlertTime"] doubleValue]];
localNotif.fireDate = date;
localNotif.timeZone = [NSTimeZone systemTimeZone];
localNotif.alertBody = [self textForAlertWithTask:task withIndex:i];
localNotif.alertAction = @"Review";
localNotif.soundName = [[defaults valueForKey:REMINDER_SOUND] stringByAppendingString:@".caf"];
localNotif.applicationIconBadgeNumber = 0;
if([task isRepeat] && [task.type isEqualToString:TYPE_TASK]){
NSDate *fireDate = [Repeat getNextRepeatedReminder:task];
if (!fireDate) return;
localNotif.fireDate = fireDate;
int interval = [[task.recurrence valueForKey:RECURRENCE_UNIT] integerValue];
if(interval == REPEAT_UNIT_DAY){
// DebugLog(@"Task is repeat - daily");
localNotif.repeatInterval = NSDayCalendarUnit;
}
else if(interval == REPEAT_UNIT_WEEK){
// DebugLog(@"Task is repeat - weekly");
localNotif.repeatInterval = NSWeekCalendarUnit;
}
else if(interval == REPEAT_UNIT_MONTH){
localNotif.repeatInterval = NSMonthCalendarUnit;
}
else if(interval == REPEAT_UNIT_YEAR){
localNotif.repeatInterval = NSYearCalendarUnit;
}
else {
// DebugLog(@"error in setting a repeating alarm!");
}
// DebugLog(@"Repeat - settings reminder to be - %d",interval);
}
DebugLog(@"scheduling the notification with title:%@\n%@",localNotif.alertBody, localNotif);
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
Бревно:
{fire date = Monday, December 9, 2013, 7:20:50 PM Israel Standard Time, time zone = Asia/Jerusalem (GMT+02:00) offset 7200, repeat interval = NSDayCalendarUnit, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Monday, December 9, 2013, 7:20:50 PM Israel Standard Time, user info = (null)}
Как вы можете видеть дату пожара и следующая дата огня одинакова, как это может быть ...? интервал повторения: «NSDayCalendarUnit» ...