GCD创建单例对象

+ (ConfigManager *)sharedInstance

{

static ConfigManager *_configManager = nil;

static dispatch_once_t onceToken;

dispatch_once(&onceToken, ^{

_configManager = [[self alloc] init];

});

return _configManager;

}

你可能感兴趣的:(GCD创建单例对象)