1

I am showing all the images from the camera roll in my iPhone app. I build an array of ALAsset * that contains the list of all images in the camera roll when the app starts. I form cells by loading these images in a image view:

// Get the full resolution image for asset
ALAssetRepresentation *assetRep = [asset defaultRepresentation]; 
UIImage *image = [UIImage imageWithCGImage:[assetRep fullResolutionImage]];
[cell.imageCropper setImage:image];

I do this when a new cell is requested in

- (AQGridViewCell *) gridView: (AQGridView *) aGridView cellForItemAtIndex: (NSUInteger) index

The problem is that it lags when there are many images and the user scrolls quickly through the images. What is the correct way of handling this?

Pulkit Goyal
  • 5,604
  • 1
  • 32
  • 50

2 Answers2

1

Consider loading the images in the background using GCD. Maybe this helps: loading images from a background thread using blocks

Community
  • 1
  • 1
HeikoG
  • 1,793
  • 1
  • 20
  • 29
1

Use thumbnail instead of fullResolutionImages

k06a
  • 17,755
  • 10
  • 70
  • 110
  • Thumbnail was too small for the app that I was working on. I ended up using `fullScreenImage` with background loading as suggested by @HeikoG. – Pulkit Goyal Sep 28 '12 at 12:10