SYNTHESIZE_SINGLETON_FOR_CLASS [英] SYNTHESIZE_SINGLETON_FOR_CLASS
问题描述
有人会详细解释我什么是 SYNTHESIZE_SINGLETON_FOR_CLASS 以及为什么我们应该使用它.实际上我在网上搜索它允许我们在不创建对象的情况下访问数据,但我们可以通过使用静态方法来做到这一点.所以如果有人可以给我一个参考,我可以从零获得 SYNTHESIZE_SINGLETON_FOR_CLASS 的完整细节.
will some body explain me in detail that what is SYNTHESIZE_SINGLETON_FOR_CLASS and why we should use it. actually i have search on net that it allow us to access a data without creating object but we can do that by using static method. so plz if someone can provide me a ref where i can get complete detatil of SYNTHESIZE_SINGLETON_FOR_CLASS from zero.
推荐答案
你的意思是 http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html?
SYNTHESIZE_SINGLETON_FOR_CLASS
只是定义的 C 宏,它生成与 Apple 的Cocoa 基础指南的创建单例实例部分一>.此链接已提供每种方法的详细信息.
SYNTHESIZE_SINGLETON_FOR_CLASS
is just a C macro defined that produce the same code template described in Apple's Creating a Singleton Instance section of the Cocoa Fundamentals Guide. This link already provides the detail what each method does.
这篇关于SYNTHESIZE_SINGLETON_FOR_CLASS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!