Skip to content

说一下对 class_ro_t 的理解? #51

Open
@tbfungeek

Description

@tbfungeek

class_ro_t 是class_rw_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;
};

这里最关键的是实例变量存放在这里。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions