In Objective-c, the invocation method takes a message-passing mechanism.
Reference article: http://blog.csdn.net/xingyevc/article/details/39397873
If a message is passed to an object, the dynamic binding mechanism of OC is used to determine the method that needs to be called.
At the bottom, all methods are ordinary C-language functions.
However, when the object receives the message, which method to drop is completely in the run-time decision, and can even change when the program is running.
These features make OC known as a true dynamic language.
To send a message to an object:
ID returnvalue = [Someobject messagename:parameter];
Translate to:
ID returnvalue = objc_msgsend (Someobject, @selector (messagename), parameter);
The Objc_msgsend function invokes the appropriate method based on the receiver and the type of the selector.
In order to do this, the method needs to search its "method list" (List of methods) in the class to which the recipient belongs
If you can find a method that matches the selection sub-name, jump to its implementation code.
If not, then follow the inheritance system to continue to look up, and so find the name matching method before jumping.
If the matching method is not found at the end, then "message forwarding" is performed
OBJECTIVE-C study notes-Next day (1)