Skip to content

Instantly share code, notes, and snippets.

@asparagui
Created September 20, 2012 13:06
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 asparagui/3755784 to your computer and use it in GitHub Desktop.
Save asparagui/3755784 to your computer and use it in GitHub Desktop.
+ (ZCDataStore *)sharedStore
{
static ZCDataStore *shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[super allocWithZone:nil] init];
});
return shared;
}
+ (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