Skip to content

Instantly share code, notes, and snippets.

@akuraru
Created April 15, 2014 06:10
Show Gist options
  • Save akuraru/10706319 to your computer and use it in GitHub Desktop.
Save akuraru/10706319 to your computer and use it in GitHub Desktop.
よくあるシングルトン
+ (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