May 2011
Beginner
834 pages
25h 19m
English
An Objective-C method is defined as part of a class. It has three aspects:
void.
As you’ve doubtless gathered, the syntax for sending a message to an object involves square brackets. The first thing in the square brackets is the object to which the message is to be sent; this object is the message’s receiver. Then follows the message:
NSString* s2 = [s uppercaseString]; // send "uppercaseString" message to s ... // ... (and assign result to s2)
If the message is a method that takes parameters, each corresponding argument value comes after a colon:
[myStack1 push: @"Hello"]; // send "push:" message to myStack1 ... // ...with one argument, the NSString @"Hello"
To send a message ...
Read now
Unlock full access