+ (XXX *)sharedInstance
{
// 1
static XXX *_sharedInstance = nil;
// 2
static dispatch_once_t oncePredicate;
// 3
dispatch_once(&oncePredicate, ^{
_sharedInstance = [[XXX alloc] init];
});
return _sharedInstance;
}
网友评论