美文网首页
isa & superclass

isa & superclass

作者: Berning | 来源:发表于2021-02-06 11:53 被阅读0次

oc 对象调用方法流程

isa & superclass

isa

  • 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] 

相关文章

网友评论

      本文标题:isa & superclass

      本文链接:https://www.haomeiwen.com/subject/cinrfktx.html