码迷,mamicode.com
首页 > 其他好文 > 详细

UItableViewCell 注册和判断的问题

时间:2016-06-03 18:50:32      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

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];

UItableViewCell 注册和判断的问题

标签:

原文地址:http://www.cnblogs.com/liuxingchen/p/5557238.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!