IOS 单例

+(CoachType *)sharedInstance{
    static CoachType *sharedInstance = nil;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[CoachType alloc] init];
    });
    
    return sharedInstance;
}
原文地址:https://www.cnblogs.com/SimonGao/p/4624863.html