cell.imageView is displayed correctly on first loading. After the UITableViewCell move off screen and back on again, suddenly cell.imageView size has changed to fill the height of the cell. Same thing when the cell set to highlighted state. cell.imageView is created in interface builder.
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomCell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSDictionary *dataType = [self.dataTypes objectAtIndex:indexPath.row];
[cell.imageView setImageWithURL:[NSURL URLWithString:[dataType valueForKey:@"imageURL"]]
placeholderImage:nil];
cell.titleLabel.text = [data valueForKey:@"name"];
cell.descriptionLabel.text = [data valueForKey:@"info"];
return cell;
}