Skip to content

Instantly share code, notes, and snippets.

@Shpigford
Created May 17, 2010 18:17
Show Gist options
  • Save Shpigford/404049 to your computer and use it in GitHub Desktop.
Save Shpigford/404049 to your computer and use it in GitHub Desktop.
static MySingletonClass *sharedGizmoManager = nil;
(MySingletonClass*)sharedManager{
if (sharedSingletonManager == nil) {
sharedSingletonManager = [[super allocWithZone:NULL] init];
}
return sharedGizmoManager;
}
(id)allocWithZone:(NSZone *)zone{
return [[self sharedManager] retain];
}
(id)copyWithZone:(NSZone *)zone{
return self;
}
(id)retain{
return self;
}
(NSUInteger)retainCount{
return NSUIntegerMax;
}
(void)release{
//do nothing
}
(id)autorelease{
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment