가는 중입니다. 핵심은 구성 요소의 요일을 반복하여 진행하고 해당 요일에서 날짜를 추출하는 것입니다. 이 날짜 첫 데이트의 포함, 마지막 날짜의 독점의 모음을 초래할 것
는
NSMutableArray *result = [NSMutableArray array];
NSCalendar *cal = [NSCalendar currentCalendar];
NSDate *startDate = // your input start date
NSDate *endDate = // your input end date
NSDateComponents *comps = [cal components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit)fromDate:startDate];
NSDate *date = [cal dateFromComponents:comps];
while (![date isEqualToDate:endDate]) {
[result addObject:date];
[comps setDay:(comps.day + 1)];
date = [cal dateFromComponents:comps];
}
참고. 아마도 가장자리 조건을 변경하는 방법에 대해 스스로 해결할 수 있습니다.
감사합니다. 매력적이었습니다. – inVINCEable