随笔分类 - 设计模式
设计模式
摘要:static Singleton *sharedSingleton = nil;+(Singleton *)sharedInstance{ if (sharedSingleton == nil) { sharedSingleton = [[super allocWithZone:NULL] init]; } return sharedSingleton;}+(id)allocWithZone:(NSZone *)zone{ return [[self sharedInstance] retain];}-(id)copyWithZone:(NSZone *)...
阅读全文