IOS 使用dispatch_once 创建单例
时间:2014-04-29 10:27:47
收藏:0
阅读:419
+ (instantClass *)sharedClient { static instantClass *_sharedClient = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _sharedClient = [[instantClass alloc] init]; }); return _sharedClient; }
评论(0)