iOS快速单例宏

// 单例
#define DECLARE_SHARED_INSTANCE(className)  
+ (className *)sharedInstance;


#define IMPLEMENT_SHARED_INSTANCE(className)  
+ (className *)sharedInstance { 
static className *sharedInstance = nil; 
@synchronized(self) { 
if (!sharedInstance) { 
sharedInstance = [[[self class] alloc] init]; 
} 
} 
return sharedInstance; 
}
原文地址:https://www.cnblogs.com/songxing10000/p/4929814.html