0

现在,我正在使用 ALAssetsLibrary 从 ALAssetsGroupSavedPhotos 和 ALAssetsGroupLibrary 收集照片。将所有资产读入一个数组后,我填充我的 UITableView ([myTable reloadData]) 以显示照片。

我发现如果用户有很多照片,延迟就会增加。有什么办法可以加快速度吗?尽管相机胶卷或照片库中的照片数量很多,但默认的 UIIMagePicker 似乎根本没有延迟。有没有办法达到同样的速度?

谢谢!

4

1 回答 1

4

只需枚举您当前需要使用enumerateAssetsAtIndexes:(NSIndexSet *)indexSet options:(NSEnumerationOptions)options usingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock资产组显示的资产,而不是使用- (void)enumerateAssetsUsingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock

你可以(我想你想填充一个表格视图)例如只是indexPath.row在你的tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath方法中的索引处枚举资产。

于 2012-05-04T11:35:08.220 回答