What´s the difference between NSWeekOfYearCalendarUnit and NSWeekCalendarUnit
-
11-12-2019 - |
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
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