title: How do I implement an image array in Xcode?
body: <p>I'm trying to create an array of images for an imageView and then change those images when a button is pressed. I'm just testing the ability for the button to cause a method to get and display the image from the array. What am I doing wrong? </p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>- (void)viewDidLoad {
  
      NSMutableArray *imagesArray = [[NSMutableArray alloc] initWithObjects:@"Image1.JPG", @"Image2.JPG", nil];
  }
  
  
  -(IBAction)img1 {
  
      [imageView setImage:[UIImage imageNamed:[imagesArray objectAtIndex:0]]];
  }
  </code></pre>
  
  <p>I also get the warning 'unused variable 'imagesArray'</p>
  
  <p>Thanks for helping!</p>