tags:

views:

32

answers:

1

i want to change image in image viewer when i click to a button... how to do this......

+1  A: 

First, implement the following method in a MyViewController.m (also, add method signature to MyViewController.h file):

MyViewController.m:

- (IBAction)handleButtonClick:(id)sender {
    imageView.image = [UIImage imageNamed:@"blah.png"];
}

MyViewController.h:

{
    IBOutlet UIImageView *imageView;
}

- (IBAction)handleButtonClick:(id)sender;

Then attach handleButtonClick action to button's Touch up inside event and imageView outlet to your image view in Interface builder.

Voila.

kovpas