0
林救了我的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"]]];
}