NSCalendar*calendar = [[NSCalendaralloc]initWithCalendarIdentifier:NSGregorianCalendar];
NSIntegerunitFlags =NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit|NSWeekdayCalendarUnit|
NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit;
_weekArray= [NSMutableArrayarray];
[_weekArrayaddObject:@"全部(14天)"];
for(inti =0; i <=14; i ++) {
NSDate*date = [nowdateByAddingTimeInterval:i*3600*24];
NSString*dateStr = [formatterstringFromDate:date];
// 修改代码
NSDateComponents*comps = [calendarcomponents:unitFlagsfromDate:date];
NSLog(@"comps==%@",comps);
NSIntegerintweek = [compsweekday];
NSString*stringDate = [NSStringstringWithFormat:@"%@ %@", dateStr, [selfweek:intweek]];
NSLog(@"dateStr===%@",dateStr);
[_weekArrayaddObject:stringDate];
}