guys, I have UITableView with some images, which are loading from internet. Images is very little, but my tableview isn't work perfect. My code:
static NSString *CellIdentifier = @"Cell";
TDBadgedCell *cell = [[[TDBadgedCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.badgeColor = [UIColor colorWithRed:((float)128 / 255.0f) green:((float)161 / 255.0f) blue:((float)176 / 255.0f) alpha:1];
NSDictionary *dict = nil;
if (searching == NO) {
dict = [companies objectAtIndex:indexPath.row];
} else {
dict = [copyListOfItems objectAtIndex:indexPath.row];
}
cell.badgeString = [NSString stringWithFormat:@"%@",[dict objectForKey:@"rating"]];
cell.textLabel.numberOfLines = 2;
cell.textLabel.text = [dict objectForKey:@"title"];
cell.textLabel.textColor = [UIColor colorWithRed:((float)80 / 255.0f) green:((float)80 / 255.0f) blue:((float)80 / 255.0f) alpha:1];
cell.textLabel.font = [UIFont fontWithName:@"Verdana" size:17.0];
UIImage *img = [[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[dict objectForKey:@"image"]]]] scaleToFitSize:CGSizeMake(16, 16)];
cell.imageView.image = img;
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
return cell;
TDBadgedCell can't be reason, because without images it works perfect. I'm using open sourse classes to resize UIImage. You can found it here.
Have you any ideas?