我正在尝试做的是让NSDate今天,昨天,这周,上周,这个月,上个月的变量准备好比较,以便在UITableView的titleForHeaderInSection上添加标头
我想要的是在下面的代码中手动完成日期2009-12-11
NSDate *today = [NSDate dateWithString:@"2009-12-11 00:00:00 +0000"];
NSDate *yesterday = [NSDate dateWithString:@"2009-12-10 00:00:00 +0000"];
NSDate *thisWeek = [NSDate dateWithString:@"2009-12-06 00:00:00 +0000"];
NSDate *lastWeek = [NSDate dateWithString:@"2009-11-30 00:00:00 +0000"];
NSDate *thisMonth = [NSDate dateWithString:@"2009-12-01 00:00:00 +0000"];
NSDate *lastMonth = [NSDate dateWithString:@"2009-11-01 00:00:00 +0000"];
https://stackoverflow.com/questions/1889164
复制相似问题