Image not showing in UIImageView in Interface Builder / iPhone

dbonneville picture dbonneville · Apr 16, 2010 · Viewed 39.8k times · Source

I have a UIView with an UIImageView dragged onto the view. All of a sudden, for all my xibs, the image no longer shows up. There is a blue X. However, when it builds, the image is there.

At one point, I deleted and regenerated all my images and moved some into a subfolder in Xcode. Normally, when you go to select an image for an UIImageView, IB allows you to pick from any image in the project. But, I can't see any of the images I had put in the folder anymore in the dropdown.

All I see in the dropdown on the Inspector is the one image I want, but that is also the one that is not showing up. And like I said, if I build it on the device or simulator, it all works.

There is some cache or something screwed up somewhere. Everything builds with no errors. I cleared the caches and rebuilt. It all works. No error or warnings. But...I can't see any other images and IB still thinks it's missing the image that is clearly selected in the dropdown.

So how do I get Xcode and IB back on track and see what assets it properly should be seeing in the XIBs?

Answer

Mihir Mehta picture Mihir Mehta · Apr 16, 2010

Try cleaning and rebuilding the project.

If it's still not working then remove all images from Xcode (select delete reference only) and then re-add them again by dragging those images into Xcode. Then re-build it and it should work.