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?
This is the code I have so far:
- (void)viewDidLoad {
NSMutableArray *imagesArray = [[NSMutableArray alloc] initWithObjects:@"Image1.JPG", @"Image2.JPG", nil];
}
-(IBAction)img1 {
[imageView setImage:[UIImage imageNamed:[imagesArray objectAtIndex:0]]];
}
I also get the warning 'unused variable 'imagesArray'
Thanks for helping!