IOS: Learning Runtime's understanding and experience
Runtime wants to do a good job of iOS development, or really a deep grasp of the language of OC is necessary to understand the things. Recently in the study of runtime, have their own some experience, sorted as follows,
One for easy access
The second is perhaps to give others some inspiration,
Third, hope to get everyone to this article to tidy up some of the shortcomings of the guidance.
what is runtime
The code we write will be translated into runtime C code execution, such as [Target dosomething], and will be converted to Objc_msgsend (target, @selector (dosomething));.
Everything in the OC is designed to be an object, and we all know that a class is initialized to an instance of an object. In fact, a class is also an object in nature, represented by a struct in runtime.
Related definitions:
| 1 2 3 4 5 6 7 8 |
Describes a method in a class typedef struct OBJC_METHOD *method; Instance variable typedef struct OBJC_IVAR *ivar; Category category typedef struct Objc_category *category; The properties declared in the class typedef struct OBJC_PROPERTY *objc_property_t; |
The representation of classes in runtime
| 1 2 3 4 5 6 7 8 9 10 11 12 13-14 |