views:

17

answers:

1

Hi,

I have this code:

  - (IBAction)next {
     static int index = 0;  // <-- here
    index++;
    // Set imageCount to as many images as are available
    int imageCount=16;
    if (index<=imageCount) {
        NSString* imageName=[NSString stringWithFormat:@"img%i", index];
        [picture setImage: [UIImage imageNamed: imageName]];
    }
}

and it is supposed to change the image on the imageview picture but it just changes the imageview to a white background and all my images are named img1 img2 img3 etc how do I make this work?

Please help.

Will

A: 

All I forget was the .jpg on the end of stringWithFormat:@"img%i" ;) Haha

Will