title: how to download image in background to set with imageView in iOS?
body: <p>i have used following code but doesn't worked for me.</p>
  
  <pre><code>UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(markerView.bounds.size.width/10, markerView.bounds.size.height/4, markerView.bounds.size.width*4/5, markerView.bounds.size.height/1.5)];
  
  NSString *strPath = [NSString stringWithFormat:@"%@",[[arrTemp valueForKey:@"image"] objectAtIndex:marker.accessibilityLabel.integerValue]];
  NSLog(@"img path %@", strPath);
  
  dispatch_async(dispatch_get_main_queue(), ^{
    UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:strPath]]];
    imgView.image = img;
  });
  </code></pre>