UIImages not displaying in TableView on iPhone, but working in Simulator
Posted
by Graeme
on Stack Overflow
See other posts from Stack Overflow
or by Graeme
Published on 2010-04-25T21:32:29Z
Indexed on
2010/04/26
4:13 UTC
Read the original article
Hit count: 610
Hi,
I have a UITable View that displays an image in the left hand side of the table cell, and it works fine in the simulator.
Only problem is, once I ran it on my device no images appear. It's just a blank white space.
Have checked that images are added to resource folder for build (which they are) and that capitals etc. match (which they do).
Any ideas?
Thanks.
Code to display images:
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 5.0;
UIImage *image = [UIImage imageNamed:[[dog types] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];;
if ( image ) {
cell.imageView.image = [image imageScaledToSize:CGSizeMake(50, 50)];
}
© Stack Overflow or respective owner