你要問我對(duì)象是什么?答案真的是千奇百怪,你是要和我處對(duì)象嗎?NO,其實(shí)本質(zhì)的原因是,我也不知道對(duì)象是什么,so,祭出終極法器------萬(wàn)物皆對(duì)象
我們都知道Objective-C所有的類都是繼承自NSObject,當(dāng)然還有NSProxy(但是我真的沒見過,暫且忽略).我們可以查看頭文件
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 *` */