注意:[list.picsArray count]是指解析出来的图片数目,但是并不确定
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
static NSString *CellIdentifier = @"Cell";
ListCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
ListModel *list = (ListModel *)[dataArray objectAtIndex:indexPath.row];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"ListCell" owner:self options:nil] lastObject];
for (int i = 0; i < [list.picsArray count]; i++) {
UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10+i*110, 115, 80, 60)];
leftImageView.tag = i+100;
[cell.contentView addSubview:leftImageView];
}
}
cell.NameLabel.text = list.name;
[cell.IconImageView setImageWithURL:[NSURL URLWithString:list.iconUrl]];
cell.DetailLabel.text = list.detailInfo;
cell.DateLabel.text = list.date;
for (int i = 0; i < [list.picsArray count]; i++) {
UIImageView *imageView = (UIImageView *)[cell.contentView viewWithTag:i+100];
[imageView setImageWithURL:list.picsArray [i]];
}
return cell;
}