更新时间:2021-07-19 22:57:20
尝试 dateWithTimeInterval:SinceDate:
NSMutableArray dates = [NSMutableArray array];
NSDate *curDate = startDate;
while([curDate timeIntervalSince1970] <= [endDate timeIntervalSince1970]) //you can also use the earlier-method
{
[dates addObject:curDate];
curDate = [MSDate dateWithTimeInterval:86400 sinceDate:curDate]; 86400 = 60*60*24
}
//here maybe an additional check if the enddate has to be inserted or not