标签:
NSString *ID=@"test";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if(cell==nil){
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
}
cell.textLabel.text=[NSString stringWithFormat:@"test%zd",indexPath.row];
//在viewDidLoad方法注册cell,注册一次即可
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:ID];
//注册之后效果同方法1
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
cell.textLabel.text=[NSString stringWithFormat:@"test%zd",indexPath.row];
标签:
原文地址:http://www.cnblogs.com/JavaTWW/p/5352626.html