What does your Objective-C singleton look like?
- by schwa
Mine is merely (or a close variant thereof):
static MyClass *gInstance = NULL;
+ (MyClass *)instance
{
@synchronized(self)
{
if (gInstance == NULL)
gInstance = [[self alloc] init];
}
return(gInstance);
}