Pavan
Pavan

Reputation: 18548

Programmatically change the UIImageView displaying image1 to image2

The UIImageView is placed in interface builder. I already created an IBOutlet. How do i programmatically change the UIImageView to view another image.

Can someone please help me?

Upvotes: 5

Views: 4410

Answers (1)

Ben Gottlieb
Ben Gottlieb

Reputation: 85542

If myImageView is your outlet, then in code, you can use:

myImageView.image = [UIImage imageNamed: @"myNewImage.png"];

Upvotes: 9

Related Questions