我需要能够将 id 作为参数与 URL 一起发送。然后程序需要异步下载图像并在 uitableview 单元格中显示图像。我怎样才能做到这一点?这是我到目前为止所拥有的:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"lisn"];
cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"lisn"] autorelease];
[[cell textLabel] setFont:[UIFont systemFontOfSize:14.0]];
switch([indexPath section]){
case 0:
cell.textLabel.text=[arryList objectAtIndex:indexPath.row];
CGRect memberFrame=CGRectMake(240,18,10,30);
UILabel *members=[[[UILabel alloc] initWithFrame:memberFrame ] autorelease];
members.text=[arryList objectAtIndex:indexPath.row + 3];
[cell.contentView addSubview:members];
break;
case 1:
cell.textLabel.text=@"Start date:";
CGRect dateFrame=CGRectMake(80,6,180,20);
UILabel *sDate=[[[UILabel alloc] initWithFrame:dateFrame] autorelease];
sDate.text=[arryList objectAtIndex:indexPath.row + 1 ];
[cell.contentView addSubview:sDate];
cell.detailTextLabel.text=@"End date:";
CGRect enddateFrame=CGRectMake(80,22,180,50);
UILabel *eDate=[[[UILabel alloc] initWithFrame:enddateFrame] autorelease];
eDate.text=[arryList objectAtIndex:indexPath.row + 2];
[cell.contentView addSubview:eDate];
break;
case 2:
cell.textLabel.text=[arryList objectAtIndex:indexPath.row + 4];
break;
case 3:
cell.imageView.image = [UIImage imageNamed:@"ic_place_holder_small.png"];
break;
break;
}
return cell;
}