+ (id)sharedInstance {
static CommonHttpUlity *sharedInstance = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
+ (id)sharedInstance {
static CommonHttpUlity *sharedInstance = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
本文标题:单例写法
本文链接:https://www.haomeiwen.com/subject/wrvvmttx.html
网友评论