当程序启动时,就会加载项目中的所有的类和分类,而且先加载父类,再加载子类
例如:一个Person类
一个Person类的子类Student类
一个Student类的子类GoodStudent类
一个Person的分类MJ类
都重写他们的+load方法,输出一段文字。
当写一段代码 GoodStudent *= [[GoodStudent alloc] init];
为什么打印结果会是
Person------Load
Student------Load
GoodStudent------Load
Person(MJ)------Load
先加载父类再加载子类,不是应该先加载父类,之后就加载父类的分类,然后再加载子类么?按照这样的想法打印结果应该是
Person------Load
Person(MJ)------Load
Student------Load
GoodStudent------Load
求大神帮助。。。 |
|