采用这个方法UIImageWriteToSavedPhotosAlbum将大量图片保存到模拟器
NSArray *strFileArr = [[NSBundle mainBundle] URLsForResourcesWithExtension:@"jpg" subdirectory:nil];
for (int i = 0; i < [strFileArr count]; i++)
{
NSMutableString *strFileName = [NSMutableString stringWithString:[[strFileArr objectAtIndex:i] absoluteString]];
NSRange range = [strFileName rangeOfString:@".app"];
if (range.length > 0)
{
strFileName = [NSMutableString stringWithString:[strFileName substringFromIndex:range.location+5]];
}
UIImage *image = [UIImage imageNamed:strFileName];
UIImageWriteToSavedPhotosAlbum(image,nil,nil,nil);
}
时间: 2024-12-19 15:07:13