Array of all NSDate for a week
问题 I would like to have a function that takes a week number as input and returns an array of all the NSDates that this specific week is made by. Something like this: -(NSArray*)allDatesInWeek:(int)weekNumber { NSDate *today = [NSDate date]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; [calendar setFirstWeekday:2]; NSDateComponents *todayComp = [calendar components:NSYearCalendarUnit fromDate:today]; int currentyear = todayComp.year; /* Calculate and