1
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
static NSDateFormatter *formatter = nil;
if (formatter == nil) {
formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
MovieSighting *sightingAtIndex = [self.dataController objectInListAtIndex:indexPath.row];
[[cell textLabel] setText:sightingAtIndex.titulo];
[[cell detailTextLabel] setText:[NSString stringWithFormat:@"%lu",(unsigned long)sightingAtIndex.anyo]];
[[cell imageView] setImage:[UIImage imageNamed:@"Batman.jpg"] ];
[[cell imageView] setImage:[UIImage imageNamed:@"300.jpg"]];
//cell.imageView.image = [UIImage imageNamed:@"Batman.jpg"];
//cell.imageView.image = [UIImage imageNamed:@"300.jpg"];
//[[cell detailTextLabel] setText:[formatter stringFromDate:(NSDate *)sightingAtIndex.date]];
return cell;
}
我想第一圖像添加到所述第一小區目標C的ImageView與TableCell的索引
cell.imageView.image = [UIImage imageNamed:@"Batman.jpg"];
我想第二圖像添加到所述第二小區
cell.imageView.image = [UIImage imageNamed:@"300.jpg"];
我應該用atIndex做什麼?