Cocoa and Objective-C make it easy to run quick test programs to view results. If you are not sure about the documentation, you can always check it yourself. I have a project that creates the Foundation command-line tool, and I just type these fragments in main.m and register them just to see what the API returns.
For example, I just ran this:
unsigned flags = NSWeekCalendarUnit; NSDateComponents *components = [[NSCalendar currentCalendar] components:flags fromDate:[NSDate date]]; NSLog(@"Week: %ld", [components week]); flags = NSWeekdayCalendarUnit; components = [[NSCalendar currentCalendar] components:flags fromDate:[NSDate date]]; NSLog(@"WeekDay: %ld", [components weekday]);
And received
Week: 37 Weekday: 7
It’s quick to see that WeekCalendar gives it as the 37th week of the year, and WeekDay says that (today is Saturday) is the seventh day of the week ("because I know that the Gregorian calendar counts as Sunday as day 1).
source share