1

当我尝试在我的 tableView 上显示自定义单元格时出现错误。我有一个与单元格连接的 nibFile,但我总是在这里得到线程 sigbart

NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CellForOffers" owner:self options:nil];

我不知道为什么,我在索引实现中的行单元格是

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"CellForOffers";
    CellForOffers *cell =(CellForOffers *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {

        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CellForOffers" owner:self options:nil];
        cell = [nib objectAtIndex:0];


        appDC * application = [dataArray objectAtIndex:[indexPath row]];

        cell.namelbl.text=application.o_name;

        cell.descriptionlbl.text=application.o_description;

        [cell.imageView setImageWithURL:[NSURL URLWithString:application.o_image_url]];


    }

    return cell;
}
4

1 回答 1

0

添加 nib 及其类,如下所示...

cell = (CellForOffers *)[nib objectAtIndex:0];
于 2012-12-18T07:23:27.687 回答