+ (XXXXStore *)sharedInstance
{
static id sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
按理说stat[......]
iOS中为什么使用dispatch_once来实现单件类
Leave a reply