2

enter image description here

Hi,

I am trying to use the attached image in an UITableView cell. Images are in application bundle. Except this image and few images, other images are showing fine in the cell. I couldn't find whats the reason to not showing this image particularly. Could someone help me if you came across such problems?

myImageView.image = [UIImage imageNamed:@"icontemp.png"] 
6
  • 1
    check the spelling of that image once. If both are same it has to show the image. Commented Mar 14, 2012 at 8:59
  • Yes, its same. I am logging all the image names. Commented Mar 14, 2012 at 9:01
  • post your entire .m code her.. Commented Mar 14, 2012 at 9:01
  • 1
    Check this once. May be your imageView is null. NSLog(@"myImageView %@",myImageView); Commented Mar 14, 2012 at 9:03
  • Check also the format of your png file, maybe you use some non-standard fancy feature (however I can't think about what would it be...) Commented Mar 14, 2012 at 9:08

5 Answers 5

3

I think you have not copied exactly the images in your application bundle that is being not displayed in the cell.

Try & check removing bunch of images and add those again in your project.

Sign up to request clarification or add additional context in comments.

3 Comments

try to post such answers in comments.. (this not being an answer only a speculation :))
Sure from next time will do it.
Its there in the bundle. But, still i removed the images and added again, it worked now.
1

I had that kind of problem lots of time. 90% times it was distraction errors :) There are lots of possible reasons. Here's are the ones I've seen :

  • You forgot to include the image to bundle
  • Your image is corrupted
  • You are using photoshop and you saved your image to PSD with a png extension (mac OS show preview of PSD files).
  • You forgot to add your view to a superview (arrives sooo often)
  • Wrong file name (imageName.png instead of imagename.png)
  • (from Ankit Srivastava) no memory allocated to imageview
  • ... if I remember some other i'd edit the post.

Hope this helps

1 Comment

you forgot the most common of them all... no memory allocated to imageview... :/
1

If you click on the image in the left-hand Project Navigator window, then select File Inspector on the right-hand Utilities window, make sure the checkbox is checked for the correct target in the Target Membership region.

Comments

0

File names are case-sensitive when used in iDevices (iPhone/iPod Touch/iPad) and in Simulator too.

2 Comments

Additionally: There seems to be an odd bug or misbehaviour regarding case. I can load "Beer.jpg" fine, but "category-Beers.png" (yes, I noticed the plural and ext changes) didn't work -- the device expected the lowercase version for some reason (but the simulator didn't!). Seems the moral of the story is to lowercase everything and save yourself the headache...
Oh, and in case it matters -- this was in a project using Swift.
0

Check also for duplicate names in bundles AND in your developing folder. (where all the code stuff is saved)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.