.h类
+(SQLManager *)shareManager;//单利
.m类
+(SQLManager *)shareManager
{
static SQLManager *manager = nil;
//保证只调用一次
static dispatch_once_t once;
dispatch_once(&once, ^{
manager = [[self alloc] init];
});
return manager;
}
网友评论