ドキュメントディレクトリに「2」という名前のフォルダーがあります。フォルダー「2」には、0.png、1.png、2.png、3.png、4.png という名前の 5 つの画像があります。これらの画像を取得して配列に保存したいと思います。コードはありますが、返される画像は 1 つだけです。
int b=2;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSLog(@"%@",paths);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%d/0.png",b]];
UIImage *img = [UIImage imageWithContentsOfFile:getImagePath];
NSLog(@"%@",getImagePath);
imge.image=img;