カメラロール、保存された写真から10〜20枚のフルスクリーン画像をすばやく読み込む方法は何ですか?
このコードを使用していますが、10枚の写真を読み込むには、約5〜10秒待つ必要があります。私はiPhone4Sを使用しています。
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if(_savedPhotos.count>=11) *stop = YES;
[group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *needToStop) {
NSLog(@"%d",index);
if(_savedPhotos.count<11)
{
UIImage *image = [UIImage imageWithCGImage:result.defaultRepresentation.fullScreenImage];
[_savedPhotos addObject:image];
}
else
{
*needToStop = YES;
}
}];
} failureBlock:^(NSError *error) {
NSLog(@"%@",error.description);
}];