方法一

+ (instancetype)shareManage
{
    static Manage *manage = nil;
    
    if (manage == nil)
    {
        manage = [[Manage alloc]init];
        
    }
    
    
    return manage;
    
}

 

方法二
+ (instancetype)shareService
{
    static ViewController *shareM = nil;
    
    static dispatch_once_t predicate;
    
    dispatch_once(&predicate, ^{
       
        shareM = [[ViewController alloc]init];
        
    });
    
    return shareM;
}

 

 
posted on 2015-07-22 15:15  火星的蝈蝈  阅读(139)  评论(0编辑  收藏  举报