views:

1266

answers:

1

I want to access a UIImage programmatically... i.e. myImage.hidden = TRUE; etc. I can do this fine for UILabel but when I repeat the process for UIImage it doesn't work. Specifically when I drag the blue line in Interface Builder over the icon I don't get a popup menu like I do when using UILabel.

Perhaps using UIImageView instead of UIImage?

Thanks!

+4  A: 

An UIImage is not a view that can be added via Interface Builder. In order to display a UIImage you either need to override the drawRect method of whatever view you want to display it in, or use a UIImageView.

Using a UIImageView will allow you to set it as an IBOutlet and reference it in your controller.

Lounges
this worked. simply change UIImage to UIImageView.
MrDatabase