Let me try this again being more clear, my apologies.
\
I am looking at trying to add a date specific reminder to my photo assignment app in iOS. I’d love to be able to have it so it will fire a reminder on exact dates of the year that will direct them to the assignments for that time of year
For example:
Dec 31st-New Years Eve-shoot fireworks, parties
July 1st-Canada Day-shoot celebrations, fireworks
October 30th-before halloween-shoot pumpkins, costumes
December 15th-Christmas lights!
Etc.
I already have a daily reminder set up that fires at 9am every day reminding them to get an assignment, which is turned on or off at the users desire by a toggle switch in the settings bundle. I was hoping to have another one for the “holiday reminders”
Here is my current code for the daily reminder:
NSDateComponents *dateComponents = [calender components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit)
fromDate:currentDate];
NSDateComponents *temp = [[NSDateComponents alloc]init];
[temp setYear:[dateComponents year]];
[temp setMonth:[dateComponents month]];
[temp setDay:[dateComponents day]];
[temp setHour: 9];
[temp setMinute:00];
NSDate *fireTime = [calender dateFromComponents:temp];
[temp release];
// set up the notifier
UILocalNotification *localNotification = [[UILocalNotification alloc]init];
localNotification.fireDate = fireTime;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
How do I covert an actual date (December 31st) to a fireDate = variable/string?
I hope that is more clear. I have searched already and have not been able to find the answer.
Thank you
Noel Chenier
You just need to specify the year, month and day manually in when creating your fireTime.