I have a UIImageView *picture
and a UIButton *next
and an
- (IBAction)next {
}
I want to change the image on the view but only if the image equals… for example img1
But using the same button I want to also be able to change the picture if the image = img2 but to a different image (img3)
So far I have this code but it gives me errors:
- (IBAction)next {
if (picture UIImage = imageNamed:@"img01.jpg") {
[picture setImage: [UIImage imageNamed:@"img02.jpg"
}
if (picture UIImage = imageNamed:@"img02.jpg") {
[picture setImage: [UIImage imageNamed:@"img03.jpg"
}
}
I figured it out now all I did was forget to put .jpg on the end of the img%i 😉