title: Load an image from URL with UIActivityIndicatorView on UIImageView
body: <p>In my iphone application, I have a UITabelview which populates the data through URL. When I select one cell from UITableview, it calls the URL and downloads the image and pass on to another UITableview. When I click the cell it takes a while to load the image and stays clicked on UITableviewcell. I have the following code which calls the URL and loads the image on each cell call.</p>
  
  <pre><code>if (!cell) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"imageCell"] autorelease];
        imageView1 = [[cell subviews] lastObject];
        [cell addSubview:imageView1 ];
  }
  
  NSString fileName = image.Img;
  NSString *filePath= [NSString stringWithFormat:@"http://www.abc.com/xml/id=12345",fileName];
  
  UIImage *im = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]]];
  subview = [[UIImageView alloc] initWithFrame:CGRectMake(120.0f, 10.0f,60.0f, 60.0f)]  ;
  [subview setImage:im]; 
  [subview setContentMode:UIViewContentModeScaleToFill];
  [cell.contentView addSubview:subview];
  </code></pre>
  
  <p>I have seen few apps where the profile pic is getting downloaded and have UIActivityIndicator loading in the data for it. I would like to use UIActivityIndicator on UIImageView in the same way. Can anyone help me out on achieving uiactivityindicator on uiimageview.</p>