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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.