Я работаю с SDWebImage и UITableView
- (UITableViewCell *)tableView:(UITableView *)the_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *MyIdentifier = [NSString stringWithFormat:@"MyIdentifier"];
NSDictionary *info = [tableData objectAtIndex:indexPath.row];
UITableViewCell *cell = [the_tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MyIdentifier] autorelease];
if(!addImage) [addImage release];
addImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"placeholder.png"]];
[addImage setFrame:CGRectMake(7, 10, 50, 50)];
[cell setIndentationLevel:6];
[cell.contentView addSubview:addImage];
}
if(info != NULL) {
cell.textLabel.text = [info objectForKey:@"title"];
cell.detailTextLabel.text = [NSString stringWithFormat:@"Version: %@",[info objectForKey:@"version"]];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
NSString *imageURL = [NSString stringWithFormat:@"%@",[info objectForKey:@"imageURL"]];
[addImage setImageWithURL:[NSURL URLWithString:imageURL] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
}
return cell;
}
, который отлично работает для первых 6 результатов (сумма, которая может поместиться при немедленном просмотре)
Но пока я прокручиваю внизПохоже, что в этом списке просто повторно используются изображения из первых 6 ячеек, а в некоторых ячейках изображения меняются в зависимости от их расположения на экране.
Кроме того, если я вызываю reloadData, изображения из предыдущихUITableCells остаются на экране!
Я что-то здесь не так делаю?Я следовал примеру кода на github ..
Спасибо!