经常会在笔试或面试中碰到的问题,记录一下官方文档的解释
Load
Invoked whenever a class or category is added to the Objective-C runtime; implement this method to perform class-specific behavior upon loading.
+ (void)load;
当一个类或一个分类添加到Objective-C 运行时环境中时,即该类被加载到程序中时,该方法会被调用。
Initialize
Initializes the class before it receives its first message.
+ (void)initialize;
当它接收到第一条消息之前调用,即调用它的第一个类方法或实例方法之前调用。
网友评论