拖拉控件TableView的使用

 

拖拉控件TableView关系如下:

并且要在cellForRow方法里面添加如下代码:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    FirstTableViewCell *cell = (FirstTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"FirstCellReuse"];
    if (cell == nil) {
        NSArray * nib = [[NSBundle mainBundle]loadNibNamed:@"FirstTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    cell.nameLabel.text = self.array[indexPath.row];
    return cell;
}
再实现它的delegate和datasource就可以了

posted @ 2015-12-11 09:26  宋婷婷  阅读(248)  评论(0编辑  收藏  举报