【发布时间】:2010-10-19 14:08:27
【问题描述】:
所以我有一个问题并且确切地知道是什么导致它,只是不知道如何解决它。基本上我有一个 tableViewCell 正在加载这样的东西:
BroadcastTableViewCell *cell = (BroadcastTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
/*
* Other code to finish cell setup
*
*/
// Problem section
CGRect frame;
frame.size.width=50; frame.size.height=70;
frame.origin.x=0; frame.origin.y=0;
AsyncImageView* asyncImage = [[[AsyncImageView alloc]
initWithFrame:frame] autorelease];
asyncImage.tag = 999;
NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://image URL/%@", trimmedPath]] autorelease];
[asyncImage loadImageFromURL:url];
[cell.contentView addSubview:asyncImage];
基本上这是一种异步加载单元格图像的方法,以便表格视图平滑滚动。问题是,当我将具有现有 ID 的新单元格出列时,图像不会被重置并被放置在新单元格下。有谁知道如何检测该图像并在新单元出列时将其删除?
【问题讨论】:
标签: iphone objective-c ipad ios