当运行时加载类时,将调用类的load方法.
类的initialize方法在类中的任何其他方法之前调用.
从加载文档:
On Mac OS X v10.5,the order of initialization is as follows:
All initializers in any framework you link to. All +load methods in your image. All C++ static initializers and C/C++ attribute(constructor) functions in your image. All initializers in frameworks that link to you.In addition:
A class’s +load method is called after all of its superclasses’ +load methods. A category +load method is called after the class’s own +load method.In a +load method,you can therefore safely message other unrelated classes from the same image,but any +load methods on those classes may not have run yet.
这清楚地表明在初始化运行时之后将运行任何属性或加载方法.因为load是类的一个方法,并且在任何属性方法之前运行,然后运行时必须设置类.
总结以上是内存溢出为你收集整理的objective-c – safe __attribute __((构造函数))函数类全部内容,希望文章能够帮你解决objective-c – safe __attribute __((构造函数))函数类所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)