#import "SingleDemo.h"
static SingleDemo* _instance = nil;
@implementation SingleDemo
-(instancetype)init{
if (self = [super init]) {
}
return self;
}
+(instancetype)shareInstance{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = [[SingleDemo alloc]init];
});
return _instance;
}
@end
网友评论