单例创建

+ (instancetype)sharedManager  
{  
        static ClassName *sharedInstance;  
        static dispatch_once_t oneToken;  
        dispatch_once(&oneToken, ^{  
                sharedInstance = [[ClassName alloc] init];   
        });  
    return sharedInstance;  
}  

你可能感兴趣的:(单例创建)