class :被定義為一個指向objc_class的結構體指針,這個結構體表示每一個類的結構體。
struct objc_class{
struct objc_class super_class; /*father class*/
const char *name;/*class name*/
long version;
long info;/*class information(類信息)*/
long instance_size; /*實例大小*/
struct objc_ivar_list *ivars;/*實例參數(shù)鏈表*/
struct objc_method_list **method;/*方法鏈表*/
struct objc_cache *cache; ?/*方法緩存*/
struct objc_protocol_list *protocols; /*協(xié)議鏈表*/
}
Mehod :方法鏈表里面方法就是method類型。其結構如下圖。
SEL;就是method的方法名。IMP指向該方法的具體實現(xiàn)的具體函數(shù)指針。method_types:該方法的參數(shù)類型;