isa & superclass
2021-02-06 本文已影响0人
Berning
oc 对象调用方法流程
isa & superclassisa
- instance->isa & ISA_MASK = class
- class->isa & ISA_MASK = meta
- meta-isa & ISA_MASK = metarootclass
superclass
- class->superclass = superclass
- superclass->superclass = rootclass
- rootclass->superclass = nil
metarootclass->surperclass = Root class
@interface NSObject<NSObject>
- (void)test;
@end
@interface BNStudent : NSObject
@end
//会调用NSObject 的 -test方法
[BNStudent test]