Multiple arguments

What if you want to know the day of the month (e.g., June 1st) for an NSDate object? An NSDate does not know this information. Instead, you must ask an instance of NSCalendar.

NSCalendar is another Foundation class. You can create an instance of NSCalendar by sending the NSCalendar class the currentCalendar message.

The class method currentCalendar will return the address of an NSCalendar instance that matches the user’s settings. (In most western countries, the Gregorian calendar is the default, but there are several other calendars, like the Hebrew calendar and the Islamic calendar.) Ask the NSCalendar class for an instance of NSCalendar.

#​i​m​p​o​r​t​ ​<​F​o​u​n​d​a​t​i​o​n​/​F​o​u​n​d​a​t​i​o​n​.​h​>​ i​n​t​ ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.