コアの部分のデータ構造

Class

struct objc_class {	
    struct objc_class *isa;	
    struct objc_class *super_class;	
    const char *name;	
    long version;
    long info;
    long instance_size;
    struct objc_ivar_list *ivars;

    struct objc_method_list **methodLists;

    struct objc_cache *cache;
    struct objc_protocol_list *protocols;
};
typedef struct objc_class *Class;

struct objc_method {
    SEL method_name;
    char *method_types;
    IMP method_imp;
};
typedef struct objc_method *Method;

struct objc_method_list {
  struct objc_method_list *obsolete;
  int method_count;
  struct objc_method method_list[1];
}

id

struct objc_object {
   objc_class isa;
} *id;
typedef struct objc_object *id;

SEL

typedef struct objc_selector *SEL;

opaque typeで構造体を宣言だけして実装はしてない。

IMP

typedef id (*IMP)(id, SEL, ...);

関数ポインタ