0

Right now, I am using the ALAssetsLibrary to gather the photos from ALAssetsGroupSavedPhotos and ALAssetsGroupLibrary. Upon reading all the assets into an array, I populate my UITableView ([myTable reloadData]) to show the photos.

I find that if the user has many photos, there is an increasing amount of delay. Is there any way to possible speed things up? The default UIIMagePicker seems to have no delay at all, despite the number of photos in the Camera Roll or PhotoLibrary. Is there any way to attain the same speed?

Thank you!

kurisukun
  • 3,149
  • 5
  • 37
  • 69
  • ALAsset will work in a separate thread, because its a BLOCK. So you have to do the user-interface stuffs in main thread. see my answer here for more details .. you can see my answer here http://stackoverflow.com/questions/13508535/add-uiimageview-into-uiscrollview-inside-block-with-alasset/13508841#13508841 – Shamsudheen TK Feb 11 '13 at 02:41

1 Answers1

4

Just enumerate the assets you currently need to display by using enumerateAssetsAtIndexes:(NSIndexSet *)indexSet options:(NSEnumerationOptions)options usingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock of your asset group and not by using - (void)enumerateAssetsUsingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock

you could (i suppose you want to fill a table view) for example just enumerate the asset at the index indexPath.row in your tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method.

Dunkelstern
  • 1,624
  • 12
  • 18