Q: Create a daily local notification that will start tomorrow I have an app that reminds user about a todo item every day but I do not not need to remind them if they already did it.
My approach to solve the problem is by creating a local notification that is fired up in a daily basis at a random time. When a todo item is already done for the day, I re-scheduled the local notification day to tomorrow by cancelling it and creating a new one dated for tomorrow. But this solution doesn't work. It seems like when you specify that a local notification is fired daily (repearInterval=NSDayCalendarUnit), it doesn't honour the fireDate day property.
Here is my code:
/*** notification is created like this ***/
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = [self randomHourMinFromDate:[NSDate date]];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = @"A todo item is due!";
localNotif.alertAction = @"View Item";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.repeatInterval = NSDayCalendarUnit;


/*** some other part of the code ***/
NSArray *scheduledNotifications = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notification = [scheduledNotifications firstObject];

// adds 1 day to notification fireDate
NSDate *newFireDate = [notification.fireData dateByAddingTimeInterval:60*60*24*1];

[[UIApplication sharedApplication] cancelLocalNotification:notification];
notification.fireDate = newFireDate;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];

Can you please tell me what I'm doing wrong? Or perhaps recommend a better solution? TIA!

A: I have a idea.  When a todo item is already done for the day, cancel the notification and create a new one. Set firedate to the current date with same time, and set dateByAddingTimeInterval: 60*60*24.
localNotification.fireDate = [CurrentDate dateByAddingTimeInterval:60*60*24];

May this could work.
