title: Changing the image of an UIImage view with a button
body: <p>Hey, I have an ImageView in my app and I want the user to be able to change the image in that image view by clicking on a button.This is the code I got</p>
  
  <p>In .h</p>
  
  <pre><code>@interface BGViewController : UIViewController {
  
      IBOutlet UIImageView *image;
  
  }
  
  @property (nonatomic, retain) IBOutlet UIImageView *image;
  
  -(IBAction)img1:(id)sender;
  -(IBAction)img2:(id)sender;
  </code></pre>
  
  <p>and in .m</p>
  
  <pre><code>@synthesize image;
  
  -(IBAction)img1:(id)sender; {
  
      UIImage *image = [UIImage imageNamed: @"Main.png"];
  
  }
  
  -(IBAction)img2:(id)sender; {
  
      UIImage *image = [UIImage imageNamed: @"Themes.png"];
  
  
  }
  </code></pre>
  
  <p>There is one button for each image by the way!</p>
  
  <p>The app builds but when I click on either one of the buttons nothings happens. </p>