在介绍两种类方法之前,NSObject Class Reference里对这两个方法说明: +(void)initialize The runtime sends initialize to each class in a program exactly one time just before the class, or any class that inherits from it, is sent its first message from within the program. (Th…
OC中有两个特殊的类方法,分别是load和initialize.本文总结一下这两个方法的区别于联系.使用场景和注意事项.Demo可以在我的Github上找到--load和initialize,如果觉得有帮助还望点个关注以示支持,总结在文章末尾. 先来看看NSObject Class Reference里对这两个方法说明: +(void)initialize The runtime sends initialize to each class in a program exactly one ti…