1
votes

I have a Window in Interface Builder. I dragged a UIImageView onto the Window and selected the image that I wanted to be displayed from Image View Attributes -> Image View -> Image, and it was on the drop down list. I see the image on the Window screen.

However, when I go to File -> Simulate Interface, it only displays a black screen.

Am I doing something incorrectly?

2
possible duplicate of Setting the image of a UIImageView in Interface Builderuser405725
I had a similar problem, but it wasn't showing on the iPad device: UIImage Showing in Simulator, but not on Device (iPad/iPhone)Khattab

2 Answers

0
votes

Perhaps your image is not part of the Simulator bundle, so the loading fails and your UIImageView will be blank.

Do the connection between image and UIImageView in code and it should show the image.

Like:

UIImage *image = [UIImage imageNamed: @"cell.png"];

Once you have an UIImage you can then set UIImageView this way:

[imageView setImage:image];
0
votes

I had the same problem.

It may be because I renamed by UIViewController h, m and xib files.

I did rm -r on my Library/Application Support/iPhone Simulator/ folder. Quit the simulator. Then tried again. Worked.

Some strange caching issue, I suspect.