Category
Category是表示一个指向分类的结构体的指针,其定义如下:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16typedef struct objc_category *Category;
struct objc_category {
char *category_name OBJC2_UNAVAILABLE; // 分类名
char *class_name OBJC2_UNAVAILABLE; // 分类所属的类名
struct objc_method_list *instance_methods OBJC2_UNAVAILABLE; // 实例方法列表
struct objc_method_list *class_methods OBJC2_UNAVAILABLE; // 类方法列表
struct objc_protocol_list *protocols OBJC2_UNAVAILABLE; // 分类所实现的协议列表
}
Protocol
Protocol定义:
1 | typedef struct objc_object Protocol; |
属性
1 |
|
其实runtime的很多函数在平时我们是用不到的,但是还是要了解一点的,以便于有时候出现的问题,自己却不知道原理,那样解决问题,有时解决了但是还不知道为什么。至于runtime的源码在这里,要下载就下载版本最高的,感兴趣的可以看一下。