Created
April 28, 2011 18:04
-
-
Save JaredCrawford/946890 to your computer and use it in GitHub Desktop.
Singleton Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(id)singleton{ | |
static dispatch_once_t once; | |
static id singleton; | |
dispatch_once(&once, ^ { singleton = [[self alloc] init]; }); | |
return singleton; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment