Created
October 11, 2011 23:01
-
-
Save PsychoH13/1279737 to your computer and use it in GitHub Desktop.
Multipleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface MyMultipleton : NSObject | |
| + (MyMultipleton *)sharedInstance; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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