I have a UILocalNotification that is supposed to fire once a day, Monday through Friday, but not on the weekend. I thought that setting the repeatInterval property of the no
Weekday in iOS just means a day inside of a week. It doesn't have the "work week" connotation as opposed to a weekend.
The documentation says it a little clearer, by suggesting that you use 1-7 as the units:
NSWeekdayCalendarUnit
Specifies the weekday unit.
The corresponding value is an kCFCalendarUnitSecond. Equal to kCFCalendarUnitWeekday. The weekday units are the numbers 1 through N (where for the Gregorian calendar N=7 and 1 is Sunday).
Source: http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html
To properly set your notifications from Monday through Friday, here's some skeleton code. Yo'll have to execute it 5 times, so it'd be good to encapsulate it inside of a method that parameters for the fireDate. I've shown how you could do it for Monday.
UILocalNotification *notification = [[[UILocalNotification alloc] init] autorelease];
// Set this to an NSDate that is for the time you want, on Monday
notification.fireDate = fireDate;
// Repeat every week
notification.repeatInterval = NSWeekCalendarUnit;