UILocalNotification Repeat Interval for Custom Alarm (sun, mon, tue, wed, thu, fri, sat)

Viewed 16421

I'm using UILocalNotification for Alarm Purpose. I have a custom option for repeat based on weekdays (sun, mon, tue, wed, thu, fri, sat). So many applications did this process. I tried My level best. But I can't get it to work. Please you guys help me....

2 Answers

Simply make a methods with parameters interval and weekday. And call the function every time u have to set alarm.But the Notifications for weekdays are to be settled separately.As I have called the method as given below:

            [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:2 :tempDict] andRepeatInterval:NSWeekCalendarUnit];
            [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:3 :tempDict]andRepeatInterval:NSWeekCalendarUnit];
            [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:4 :tempDict] andRepeatInterval:NSWeekCalendarUnit];
            [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:5 :tempDict] andRepeatInterval:NSWeekCalendarUnit];
            [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:6 :tempDict] andRepeatInterval:NSWeekCalendarUnit];

I passed weekday parameter for different days of week as 2 for monday,3 for tuesday and so on.

I hope it will help u...!
Related