|
[Objective-C] How to use GDC for create a singleton class |
|
 |
+ (id)sharedInstance
{
static dispatch_once_t once;
static id instance;
dispatch_once(&once, ^{
instance = self.new;
});
return instance;
}
|
|
|
|
|
|
|
|
Copyright © 1996-2021 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581. |
|
|
|