Singleton(Chapter 7 of Pro Objective-C Design Patterns for iOS)
摘要:
#import"Singleton.h"@implementationSingletonstaticSingleton*sharedSingleton=nil;+(Singleton*)sharedInstance{if(sharedSingleton_==nil){sharedSingleton_=[[superallocWithZone:NULL]init];}returnsharedSingleton_;}+(id)allocWithZone:(NSZone*)zone{return[[selfsharedInstance]retain];}-(id)copyWith 阅读全文
posted @ 2012-04-10 12:47 Ray Z 阅读(281) 评论(0) 推荐(0) 编辑