title: [library assetForURL:url resultBlock:^(ALAsset *asset) Not execute
body: <p>I am getting image asset in this way when user select images from the image picker.</p>
  
  <pre><code>-(NSMutableData *)GetImageAsset :(int)index
     {
  dm=[DataManager sharedManager];
  NSURL *url=[dm.imgAssetsArr objectAtIndex:index];
  __block NSMutableData *data;
  ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
  [library assetForURL:url resultBlock:^(ALAsset *asset)
   {
  
  
           if (asset) {
               ALAssetRepresentation *representation = [asset defaultRepresentation];
               data = [NSMutableData data];
               NSError *error;
               long long bufferOffset = 0ll;
               NSInteger bufferSize = 10000;
               long long bytesRemaining = [representation size];
               uint8_t buffer[bufferSize];
               while (bytesRemaining &gt; 0) {
                   NSUInteger bytesRead = [representation getBytes:buffer fromOffset:bufferOffset length:bufferSize error:&amp;error];
                   if (bytesRead == 0) {
                       NSLog(@"error reading asset representation: %@", error);
                       return;
                   }
                   bytesRemaining -= bytesRead;
                   bufferOffset   += bytesRead;
                   [data appendBytes:buffer length:bytesRead];
           }
  
  
  
   }
  
   }
          failureBlock:^(NSError *error)
            {
  
                 NSLog(@"assetForURL error = %@", error);
  
            }];
  
  
  return data;
  }
  </code></pre>
  
  <p>But this never go inside the block. just skip the block and go to <code>return</code> statement. So my <code>data</code> always become null. Why is that.
  Please help me.
  Thanks</p>