@interface GlobalSingleton : NSObject{}+(GlobalSingleton*)sharedGlobalSingleton;
@implementation GlobalSingleton-(id)init{ self = [super init]; if(self){ //全局属性初始化 } return self;}+(GlobalSingleton*)sharedGlobalSingleton{ static GlobalSingleton *sharedGlobalSingleton; @synchronized(self){ if (!sharedGlobalSingleton) sharedGlobalSingleton = [[GlobalSingleton alloc] init]; return sharedGlobalSingleton; }}