ios 判断对象是否存在/是否已经初始化

ios 判断对象是否存在

if (NULL==commonTableView) {    //ios 判断对象是否存在
        //初始化tableview
        commonTableView  = [[UITableView alloc]initWithFrame:CGRectMake(0, 44+37, 320,Screen_height-44-37)];
        commonTableView.delegate = self;
        commonTableView.dataSource = self;
        [self.view addSubview:commonTableView]; 
    }else {
        [commonTableView reloadData];
    }

 

posted @ 2013-05-27 20:25  ygm900  阅读(6474)  评论(0编辑  收藏  举报