Skip to content

Instantly share code, notes, and snippets.

@colemancda
Created April 13, 2013 19:52
Show Gist options
  • Save colemancda/5379802 to your computer and use it in GitHub Desktop.
Save colemancda/5379802 to your computer and use it in GitHub Desktop.
Store Singleton Implementation
+ (<#Class#> *)sharedStore
{
static <#Class#> *sharedStore = nil;
if (!sharedStore) {
sharedStore = [[super allocWithZone:nil] init];
}
return sharedStore;
}
+ (id)allocWithZone:(NSZone *)zone
{
return [self sharedStore];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment