From Apple’s Obj-C documentation:
If the method returns an object, then a message sent to nil returns 0
(nil). For example:Person *motherInLaw = [[aPerson spouse] mother];If the spouse object here is nil, then mother is sent to nil and the method returns
nil.
so spouse here can be an object? If it is an object, must it be a selector?
A selector is like a class method in a C++ class, it’s a name of a method you call, with you defining the number and type of parameters it’ll accept. It isn’t an object at all. In the example above, “spouse” is a method name you call. It is never an object.
Edit:
The code
can be expanded to this:
As you see, the “mother” method is called on the return value of the “spouse” method. This should clear any confusion.