Introduction to the run-time mechanism

Source: Internet
Author: User

Introduction to the run-time mechanism

Runtime

Runtime is everything between your each function call!

The OBJECTIVE-C program can interact with the runtime system at three different levels:

The POBJECTIVE-C source program P calls the run-time function directly through the method P defined in the NSObject class

In most cases, the runtime system works only behind the scenes, primarily for writing and compiling objective-c source programs

Find the runtime documentation in the online Help

Oc/c/c++ the compilation process

Use Clang to rewrite. m files as CPP files

Open Terminal

PCD project file directory PCLANG-REWRITE-OBJC Main.mpopen main.cpp

Tip: To understand the underlying implementation mechanism, the easier The rewrite code is, the better

Runtime Walkthrough--getting an array of object properties

String Assignment

Objc_msgsend

Class_copypropertylist

About Arc & MRC

ARC is the retain and release of the object at run time without the need for programmer involvement

Apple's compiler developers have done countless tests on the arc and can say that there is little memory management error with ARC

In addition, because of the additional optimization of the compilation, the arc code is much more efficient than the code that the programmer manages the memory manually.

Q & A

Introduction to the run-time mechanism

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.