UItableViewCell 注册和判断的问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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];
以上是关于UItableViewCell 注册和判断的问题的主要内容,如果未能解决你的问题,请参考以下文章