NSCalendar *currentCalendar = [NSCalendar currentCalendar];
NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
[dateComponents setWeekOfYear:30];
[dateComponents setYear:2014];
NSDate *dayOfTheGivenWeek = [currentCalendar dateFromComponents:dateComponents];
dayOftheGivenWeek
实际上是2014-01-01 00:00:00 CST
,尽管我将weekOfYear
设置为30.任何想法都是为什么?