Hi all,
I have a three UIImageView variables called myPicture1, myPicture2 and myPicture3. In a for loop I am trying to increase the number at the end of myPicture by 1 so that I can assign a random image to each of the three variables. Here is the code below :
for (i=0; i<3; i++) {
int g = arc4random() % 19;
NSString *imagename = [NSString stringWithFormat:@"image%d.jpg",g];
UIImage *picture = [UIImage imageNamed:imagename];
UIImageView imageView = [[UIImageView alloc] initWithImage : picture];
self.myPicture1 = imageView; **This is where I want myPicture to increase to myPicture 2 and then 3 **
}
Is this possible ?
Thanks all,
Martin