Created
September 24, 2012 00:55
-
-
Save mmassaki/3773649 to your computer and use it in GitHub Desktop.
Objective-C Singleton (With ARC)
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)sharedInstance | |
{ | |
static class *sharedInstance; | |
static dispatch_once_t done; | |
dispatch_once(&done, ^{ | |
sharedInstance = [class new]; | |
}); | |
return sharedInstance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment