创建单例类

+ (MYManager *)shareManager {
    static dispatch_once_t once;
    static MYManager * __singleton__;
    dispatch_once(&once, ^{
        __singleton__ = [[MYManager alloc] init];
    });
    return __singleton__;
}

 

posted @ 2018-01-30 10:13  Zsmile  阅读(127)  评论(0编辑  收藏  举报

屛去雕饰,反近自然。