I'm trying to find if a date is Monday.
To do this I proceed this way :
#define kDateAndHourUnitsComponents NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
// for test and debug purpose
NSDateComponents* b = [calendar components:kDateAndHourUnitsComponents fromDate:retDate];
int a=[[calendar components:kDateAndHourUnitsComponents fromDate:theDate] weekday];
// -----------
if ([[calendar components:kDateAndHourUnitsComponents fromDate:theDate] weekday] == EKMonday) DoThis....
But this doesn't work... a and b does not contain anything useful (a equals 2147483647),
I also wonder what can be the use of [calendar components:NSWeekdayCalendarUnit fromDate:retDate]
that is not useful anymore in that case...
I also found this that confirms the process : How to check what day of the week it is (i.e. Tues, Fri?) and compare two NSDates?
What did I miss ?