ios 苹果官方的单例(学习)

 

+ (NetworkManager *)sharedInstance

{

    static dispatch_once_t  onceToken;

    static NetworkManager * sSharedInstance;

 

    dispatch_once(&onceToken;, ^{

        sSharedInstance = [[NetworkManager alloc] init];

    });

    return sSharedInstance;

}

posted @   妖妖yaoyao  阅读(173)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示