Skip to content

Instantly share code, notes, and snippets.

@dbrajkovic
Created January 9, 2012 04:47
Show Gist options
  • Save dbrajkovic/1581185 to your computer and use it in GitHub Desktop.
Save dbrajkovic/1581185 to your computer and use it in GitHub Desktop.
Singlton
+ (id)allocWithZone:(NSZone *)zone {
return [[self sharedManager] retain];
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
- (void)release {
// never release
}
- (id)autorelease {
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment