iOS 开发 自定义 xibcell 重用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangletiancsdn/article/details/51153840
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID = @"cellid";
    AotuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
       [tableView registerNib:[UINib nibWithNibName:@"AotuTableViewCell" bundle:nil] forCellReuseIdentifier:cellID];
//        NSLog(@"%ld",++i);
        cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    }
    return cell;
}
简单的几行经常忘!!!记下来

猜你喜欢

转载自blog.csdn.net/wangletiancsdn/article/details/51153840