单例

.h

+ (instancetype)managerCenter;

.m

+ (instancetype)managerCenter {

static UserInfoManagerCenter *center = nil;

static dispatch_once_t predicate;

dispatch_once(&predicate, ^{

center = [[UserInfoManagerCenter alloc] init];

});

return center;

}

你可能感兴趣的:(单例)