UItableViewCell 注册和判断的问题

UitableView 一般的情况都是在

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];

    if (!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];

    }

    cell.textLabel.text = self.bodyarray[indexPath.row];

    cell.detailTextLabel.text  = self.timeArray[indexPath.row];

    return cell;

}

如果不写判断if(!cell)的话 就需要些注册

[self.tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:cellID];

posted @ 2016-06-03 18:16  偷吃的喵  阅读(189)  评论(0编辑  收藏  举报