I want to change the image in an imageview at the click of a button.
Sample code:
NSMutableArray *array = [[NSMutableArray alloc]init];
[array addObject:[UIImage imageNamed:@"pic1.png"]];
[array addObject:[UIImage imageNamed:@"pic2.png"]];
[array addObject:[UIImage imageNamed:@"pic3.png"]];
NSLog(@"%i" , [array count]);
for (int i = 0; i < [array count]; i++) {
[type setImage:[array objectAtIndex:i]];
}
When I click the button, it displays pic3 and nothing else. Can anyone point me in the right direction?