我的Objective-C单身人物应该是什么样的?
我的单例访问器方法通常是以下的一些变体:
static MyClass *gInstance = NULL;+ (MyClass *)instance{
@synchronized(self)
{
if (gInstance == NULL)
gInstance = [[self alloc] init];
}
return(gInstance);}我可以做些什么来改善这个?
慕田峪9158850
海绵宝宝撒
偶然的你
大话西游666
随时随地看视频慕课网APP