1 つの画像ビューに画像を表示したいのですが、IBAction が呼び出されると、代わりに次の画像が表示されます。これはこれまでの私のコードです
- (void)viewDidLoad
{
[super viewDidLoad];
//init array with images what you have
images = [[NSArray alloc] initWithObjects:@"IMG_2605.JPG",@"IMG_2627.JPG",@"IMG_2597.JPG",@"IMG_2613.JPG",@"IMG_2596.JPG ",nil];
indexImage = 0;
}
-(IBAction)button1:(id)sender {
NSString *imageName = [images objectAtIndex:indexImage];
self.image1.image = [UIImage imageNamed:imageName];
self.image1.image = [images objectAtIndex:indexImage];
indexImage++;
NSLog(@"B = 1");
}