面试教训之ios的单例模式的未知













@synchronized(
if(shareRootViewController==nil){
shareRootViewController=[[[self alloc] init]autorelease];
}
}
return shareRootViewController;



@synchronized(self){
if (shareRootViewController==nil) {
shareRootViewController=[super allocWithZone:zone];
return shareRootViewController;
}
}
return nil;


面试教训之ios的单例模式的未知