title: How to pre load images in ios
body: <p>I loaded XML data (including images, text,...) from server and display that data through tableview.</p>
  
  <pre><code>- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
  {
  if([elementName isEqualToString:@"user_id"])
  {
      Myxml.str_user_id = currentNodeContent;
  }
  
  else if([elementName isEqualToString:@"username"])
  {
      Myxml.str_username = currentNodeContent;
  
  }
  else if([elementName isEqualToString:@"avatar"])
  {
      Myxml.str_avatar=currentNodeContent;
      Myxml.imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:currentNodeContent]];
  
  }
  else if([elementName isEqualToString:@"full_name"])
  {
      Myxml.str_full_name=currentNodeContent;
  
  }
  else if([elementName isEqualToString:@"cups"])
  {
      Myxml.str_cups=currentNodeContent; 
  }
  //--------Record End-------
  else if([elementName isEqualToString:@"record"])
  {
      [RecordArray addObject:Myxml];
      [Myxml release];
      Myxml = nil;        
  }
  
  [currentNodeContent release];
  currentNodeContent = nil;
  currentNodeContent = [[NSMutableString alloc]init];
  </code></pre>
  
  <p>}</p>
  
  <p>Now, In main view controller I collect all data in NSMutableArray named "LabelArray" in init method</p>
  
  <pre><code>Connection=[[NetworkConnection alloc]initConnection];
  
  if (Connection.isReachable)
  {
      XmlDetail=[[TopPickerXML alloc]init];
  
      LabelArray=[[NSMutableArray alloc]initWithArray:XmlDetail.RecordArray];
  }
  else
  {
      UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Alert" message:@"Network connection unavailable..." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
      [alert show];
      [alert release];
  }
  </code></pre>
  
  <p>And In Table view in cellForRowAtIndexPath, I display image like this</p>
  
  <pre><code>img_BuddyAvtar=[[UIImageView alloc]init];
  img_BuddyAvtar.frame=CGRectMake(10, 5, 120, 105);
  img_BuddyAvtar.image=[UIImage imageWithData:TopPicker_record.imageData];
  img_BuddyAvtar.backgroundColor=[UIColor clearColor];
  [View_TableCell addSubview:img_BuddyAvtar];
  </code></pre>
  
  <p>Now ,My problem is when I load this view it takes time to load and then displays all data including my text and images.How can i Preload images so that it would take less time to load my table view?</p>