add image to uitableview cell

AMH picture AMH · May 3, 2011 · Viewed 110.5k times · Source

I have a tableview, how can I add image to the left of this cells?

Answer

André Morujão picture André Morujão · May 3, 2011
cell.imageView.image = [UIImage imageNamed:@"image.png"];

UPDATE: Like Steven Fisher said, this should only work for cells with style UITableViewCellStyleDefault which is the default style. For other styles, you'd need to add a UIImageView to the cell's contentView.