November 2013
Beginner
325 pages
9h 47m
English
Methods are like functions. They contain code to be executed on command. In Objective-C, to execute the code in a method, you send a message to the object or class that has that method.
The NSDate class has a date method. In the code you just wrote, you sent the date message to the NSDate class to execute the date method.
NSDate *now = [NSDate date];
This was your first message send.
A message send is surrounded by square brackets and has two parts: the receiver and the selector.
Figure 13.3 A message send
What does sending the date message do? When the date method is ...
Read now
Unlock full access