+ (instancetype)shared {
static Share *shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[Share alloc]init];
});
return shared;
}
+ (instancetype)shared {
static Share *shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[Share alloc]init];
});
return shared;
}
本文标题:iOS开发GCD单例模式
本文链接:https://www.haomeiwen.com/subject/whwodxtx.html
网友评论