自定义cell另一种方法

来源:互联网 发布:阿里云发票抬头修改 编辑:程序博客网 时间:2024/04/29 06:41
@property (retain, nonatomic) UINib *cellNib;

viewDidLoad 中 self.cellNib = [UINib nibWithNibName:@"ChatTableCellView" bundle:nil];

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 中 ChatTableViewCell *cell = (ChatTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    
    
    if (cell == nil) {
        [self.cellNib instantiateWithOwner:self options:nil];
        cell = self.tmpCell;
原创粉丝点击