Customizing the UIImageView Image in the Builder Interface

When I set the image for UIImageView to IB and simulate the interface, buttons and stuff appear, but image viewing does not work.

+5
source share
1 answer

This is because the simulator used by the Builder interface is independent of your project. It just takes your xib files, creates an interface and displays it. Thus, any resources to which he refers, but cannot find, will be skipped. Therefore, if your UIImageViewuses an image called "myImage.png", then when the simulator starts, it will try to execute [UIImage imageNamed:@"myImage.png"];. Since "myImage.png" is not part of the Simulator package, it will not be able to create an image, and your UIImageView will be empty.

It can create buttons because (obviously) the buttons are standard, globally accessible. Resources for your project are not.

+7
source

All Articles