Question

I have a NSCalendar:

what´s the Differnece beteween:

NSDateComponents *dateComponents;
dateComponents = [cal components:(NSWeekOfYearCalendarUnit ) fromDate: testDate ];
dateComponents = [cal components:(NSWeekCalendarUnit ) fromDate: testDate ];

They both return 10 for this week. Thanks

Was it helpful?

Solution

They are supposed to be the same.

As shown in How to get a week number from NSDate consistently in all iOS versions?, there's apparently a bug in iOS 5 where they give different results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top