Skip to content

Instantly share code, notes, and snippets.

@PsychoH13
Created October 11, 2011 23:01
Show Gist options
  • Select an option

  • Save PsychoH13/1279737 to your computer and use it in GitHub Desktop.

Select an option

Save PsychoH13/1279737 to your computer and use it in GitHub Desktop.
Multipleton
@interface MyMultipleton : NSObject
+ (MyMultipleton *)sharedInstance;
@end
@implementation MyMultipleton
+ (MyMultipleton *)sharedInstance;
{
static MyMultipleton *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[MyMultipleton alloc] init];
});
return sharedInstance;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment