
OC
文章平均质量分 54
agan11423
我们就是修理连
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
metaclass初步研究
/************************************************************************ objc_allocateClassPair* fixme* Locking: acquires runtimeLock**********************************************************************/Class objc_allocateClassPair(Class superclass,原创 2021-06-17 14:52:59 · 190 阅读 · 0 评论 -
通过将OC编译成C++ 一探究竟(边学编写,帮忙点评)
只说重点找到类得信息,如下:struct _class_t { struct _class_t *isa; struct _class_t *superclass; void *cache; void *vtable; struct _class_ro_t *ro;};struct _class_ro_t { unsigned int flags; unsigned int instanceStart; unsigned int instanceSize; const.原创 2021-03-25 15:23:39 · 310 阅读 · 0 评论 -
Runtime 源码梳理: 草稿
/// An opaque type that represents an Objective-C class.typedef struct objc_class *Class;/// Represents an instance of a class.struct objc_object { Class _Nonnull isa OBJC_ISA_AVAILABILITY;};/// A pointer to an instance of a class.typedef str.原创 2021-03-23 21:25:32 · 177 阅读 · 0 评论 -
2021年iOS基础知识汇总-初步学习篇
Category类struct category_t { const char *name; classref_t cls; struct method_list_t *instanceMethods; struct method_list_t *classMethods; struct protocol_list_t *protocols; struct property_list_t *instanceProperties; // Field..原创 2021-03-23 10:39:54 · 529 阅读 · 0 评论 -
OC Protocol(待续)
Protocol协议声明任何类都可以选择实现的编程接口。协议使得两个通过继承而远近相关的类可以相互通信以实现某个目标。因此,它们提供了一种替代子类化的方法。任何可以提供对其他类有用的行为的类都可以声明一个编程接口,以匿名方式提供该行为。任何其他类都可以选择采用协议并实现其一个或多个方法,从而利用该行为。如果协议采纳者实现了协议中的方法,则声明协议的类将调用这些方法。其实OC中的Protocol跟Java中的Interface是非常相似的。Formal and Informal Protocols有原创 2020-10-15 13:32:28 · 315 阅读 · 0 评论