これでNSDocumentsDirectoryに画像を保存しています:
for (int i = 0; i < info.count; i++) {
NSLog(@"%@", [info objectAtIndex:i]);
NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"oneSlotImages%d.png", i]];
ALAssetRepresentation *rep = [[info objectAtIndex: i] defaultRepresentation];
UIImage *image = [UIImage imageWithCGImage:[rep fullResolutionImage]];
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:YES];
}
それらを配列にロードするのに問題があります。ネットで検索しました。これはに使用できますNSDocumentsDirectory
か?
for(int i = 1; i <= 21; i++)
{
[images addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"Images%d.png", i] ofType:@"jpg"]]];
}