RosettaCodeData/Task/Singleton/Objective-C/singleton-3.m

11 lines
235 B
Mathematica
Raw Permalink Normal View History

2013-06-05 21:47:54 +00:00
+ (SomeSingleton *) sharedInstance
{
static SomeSingleton *sharedInstance = nil;
@synchronized(self) {
if (!sharedInstance) {
sharedInstance = [[SomeSingleton alloc] init];
}
}
return sharedInstance;
}