Skip to content

Instantly share code, notes, and snippets.

@ariok
Created December 8, 2013 11:21
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 ariok/7856111 to your computer and use it in GitHub Desktop.
Save ariok/7856111 to your computer and use it in GitHub Desktop.
Basic Singleton pattern implementation
+ (AnythingManager*)sharedAnythingManager{
static AnythingManager *anythingManager;
static dispatch_once_t token;
dispatch_once(&token, ^{
anythingManager = [[AnythingManager alloc]init];
});
return anythingManager;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment