美文网首页
+ (void)load

+ (void)load

作者: ParkinWu | 来源:发表于2015-09-25 10:29 被阅读76次

+ (void)load

Apple文档中:

Invoked whenever a class or category is added to the Objective-C runtime; implement this method to perform class-specific behavior upon loading.
初始化顺序
1.调用你链接的framework初始化方法
2.你程序中所有的+ (void)load方法
3.所有C/C++中静态初始化方法,和构造方法
4.调用给你链接的framework初始化方法

总结:也就是类环境的初始化,为运行做好准备
调用顺序:
父类load->子类load->类目(category) load

相关文章

网友评论

      本文标题:+ (void)load

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