Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 597 Bytes

14.第十四题.md

File metadata and controls

27 lines (18 loc) · 597 Bytes

14.说一下对 class_ro_t 的理解?

存储了当前类在编译期就已经确定的属性、方法以及遵循的协议。

struct class_ro_t {  
    uint32_t flags;
    uint32_t instanceStart;
    uint32_t instanceSize;
    uint32_t reserved;

    const uint8_t * ivarLayout;

    const char * name;
    method_list_t * baseMethodList;
    protocol_list_t * baseProtocols;
    const ivar_list_t * ivars;

    const uint8_t * weakIvarLayout;
    property_list_t *baseProperties;
};

baseMethodListbaseProtocolsivarsbaseProperties三个都是以为数组。