OC

  • OC对象的本质是结构体
  • 方法的本质是发送消息
  • 消息的组成
    ((void (*)(id, SEL))(void *)objc_msgSend)((id)p, sel_registerName("run"));
    消息接受者 消息编号 ....参数 (消息体)
    (id)p 消息接受者
    sel_registerName("run") 方法编号
    imp 函数实现的指针 通过sel找到imp
  • 方法 对象方法、类方法

你可能感兴趣的:(OC)