+ (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#> });
时间: 2024-12-16 09:51:09