title: ALAssetsLibrary accessing all photos 1000 + from camera roll app crashes
body: <p>I want to access all photos from camera roll my code is working fine if i have few images in camera roll then app is working fine but if i have more than 1000 photos then app crashes here is my code </p>
  
  <pre><code>ALAssetsLibrary *al = [[ALAssetsLibrary alloc] init];
  
       [al enumerateGroupsWithTypes:ALAssetsGroupAll
  
                        usingBlock:^(ALAssetsGroup *group, BOOL *stop)
       {
           NSMutableArray *arrImages=[[NSMutableArray alloc]init];
           NSString *albumName = [group valueForProperty:ALAssetsGroupPropertyName];
           if (albumName !=nil) {
  
  
           [arrGroupsNames addObject:albumName];
           [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop)
            {
                if (asset)
                {
  
                    UIImage *img=[self imageForAsset:asset];
  
  
                    [arrImages addObject:img];
  
                }
            }
             ];
  
           [arrGroups addObject:arrImages];
           }
  
  
  
           [self.tableVieww reloadData];
  
       }
  
  
  
                      failureBlock:^(NSError *error)
       {
           // User did not allow access to library
           NSLog(@"error");
        }
       ];
  </code></pre>
  
  <p>and here is the function which return image from ALAsset</p>
  
  <pre><code>-(UIImage*) imageForAsset:(ALAsset*) aAsset{
  
      ALAssetRepresentation *rep;
  
      rep = [aAsset defaultRepresentation];
  
      return [UIImage imageWithCGImage:[rep fullResolutionImage]];
  }
  </code></pre>