类的本质其实也是一个对象(类对象),是Class类型,可是Class不就是结构体指针的别名吗?为什么不叫结构体指针变量,我有点凌乱
类的结构体
- struct objc_class {
- Class isa OBJC_ISA_AVAILABILITY;
- #if !__OBJC2__
- Class super_class OBJC2_UNAVAILABLE;
- const char *name OBJC2_UNAVAILABLE;
- long version OBJC2_UNAVAILABLE;
- long info OBJC2_UNAVAILABLE;
- long instance_size OBJC2_UNAVAILABLE;
- struct objc_ivar_list *ivars OBJC2_UNAVAILABLE;
- struct objc_method_list **methodLists OBJC2_UNAVAILABLE;
- struct objc_cache *cache OBJC2_UNAVAILABLE;
- struct objc_protocol_list *protocols OBJC2_UNAVAILABLE;
- #endif
- } OBJC2_UNAVAILABLE;
- /* Use `Class` instead of `struct objc_class *` */
复制代码- /// An opaque type that represents an Objective-C class.
- typedef struct objc_class *Class;
复制代码
是不是我的理解出现问题了,还是这仅仅是一个定义
|