I am loading the image to the tableView, each time function
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
is executed, different url of image will come..
My problem is its taking so much time to load the image..
My code is..
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
self.tableView1 = tableView;
static NSString *simpleTableIdentifier = @"SimpleTableCell";
SimpleTableCell *cell = (SimpleTableCell *)[tableView1 dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.nameLabel.text = title;
NSString *imageURL = [NSString stringWithFormat: @"http://www.xyz.com/image1.png];
cell.thumbnailImageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:fullURL]]];
}
return cell;
}
every time the image url will change and it will take time to load each image..
can any one suggest any idea to solve this problem? how multithreading will work with this code? where and what should i edit in the code?