I think you have a little code from the code.
- (UIImage*) bgImageforPage:(NSInteger)index { NSString* imageName =[NSString stringWithFormat:@"bg_0%ld.jpg", index+1];
if you cannot use the lower code and use the upper code, you get your result or the same as the lower code, and use the upper code, and then get the same result.
- (UIImage*) bgImageforPage:(NSInteger)index { NSString* imageName =[NSString stringWithFormat:@"bg_0%ld.jpg", index+1]; UIImage* image;// = [UIImage imageNamed:imageName]; if (index == 0) { image = [UIImage imageNamed:imageName]; } else if (index == 1) { image = [UIImage imageNamed:imageName]; } else if (index == 2) { image = [UIImage imageNamed:imageName]; } else if (index == 3) { image = [UIImage imageNamed:imageName]; } return image; }
Please add the image name to the application folder as shown below.
(Note: your image name is listed below, as in your project.)
Example Image Name : -

Your condition is surprising that you received a new index, but do not receive the image, but when you specify the image name in the same way as the name of the top image, and you receive your images as an index.
source share