Skip to content

Instantly share code, notes, and snippets.

@motoishmz
Created June 4, 2013 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motoishmz/5704876 to your computer and use it in GitHub Desktop.
Save motoishmz/5704876 to your computer and use it in GitHub Desktop.
@implementation Test
static Test *singleton_ = nil;
+ (Test*)singleton
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
singleton_ = [Test new];
});
return singleton_;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment