Created
April 15, 2014 06:10
-
-
Save akuraru/10706319 to your computer and use it in GitHub Desktop.
よくあるシングルトン
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
+ (instancetype)sharedManager { | |
static id manager_ = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
manager_ = [[self alloc] init]; | |
}); | |
return manager_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment