标签:
+ (SingletonObject *)shareInstance; + (SingletonObject *)shareInstance { static SingletonObject *__singletion; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ __singletion=[[self alloc] init]; }); return __singletion; }
static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ <#code to be executed once#> });
标签:
原文地址:http://www.cnblogs.com/fisland/p/4302029.html