您的位置:首页 > 移动开发 > IOS开发

IOS 学习记录 表格单元格放入缓存池

2015-08-25 14:41 357 查看
(instancetype)cellWithTableView:(UITableView *)tableView

{

static NSString *ID = @”tg”;

MJTgCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];

if (cell == nil) {

// 从xib中加载cell

cell = [[[NSBundle mainBundle] loadNibNamed:@”MJTgCell” owner:nil options:nil] lastObject];

}

return cell;

}

在程序中调用该方法

// 1.创建cell

MJMessageCell *cell = [MJMessageCell cellWithTableView:tableView];

// 2.给cell传递模型
cell.messageFrame = self.messageFrames[indexPath.row];

// 3.返回cell
return cell;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios