iOS 单利的写法

来源:互联网 发布:局域网服务器软件 编辑:程序博客网 时间:2024/05/18 22:13

+(instancetype)sharedInstance{


    staticViewController* vc = nil;

    

    if (vc==nil) {

        vc = [[ViewControlleralloc]init];

    }

    

    return vc;

}

0 0