"Effective objective-c" Reading notes (1)

Source: Internet
Author: User



Objective-c language uses "message structure" rather than "function call"



The message structure is represented as follows:


 
// Messageing (Objective-C) 
Object *obj = [Object new];
[obj performWith:parameter and:parameter2];


The function call is represented as follows:


 
// Function Calling(C++) 
 Object *obj = new Object;
obj->perform(parameter1, parameter2);

 





The difference is that, using the language of the message structure, the code executed by the runtime is determined by the runtime environment, and the language used by the function call is determined by the compiler



Objective-c uses a dynamically bound message structure, that is, the type of the object is checked at run time, and what code should be executed after a message is received. There is a run-time environment instead of a compiler to decide.



Objective-c's important work is done by "run-time components" rather than compilers, and all the data structures and functions required to use Objective-c's object-oriented features are in the run-time component, which includes all memory management methods in the run-time component.



A run-time component is essentially a "dynamic library" that is linked to a developer's code, which can glue all the programs written by the developer. So updating the run-time component can improve the performance of your application.



"Effective objective-c" Reading notes (1)


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.