Hello stack overflow,
So I have a problem and know exactly what is causing it, just not how to fix it. Basically I have a tableViewCell that is loading something like this:
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];
Basically this is a way to asynchronously load the cell images so the tableview scrolls smoothly. The problem is, when I dequeue a new cell with the existing ID, the image does not get reset and is placed under the new one. Does anyone know how to detect that image and remove it when a new cell is dequeued?