I created a Custom tableView and using my own tableView class in the Other class to display the tableView ..
I download the image from the server and display it in tableViewRow .. each image is different from it.
Only 7 out of 10 images will appear on the screen, and when I scroll down, the first 3 images are repeated for some time, and when these images are loaded, it shows the correct images .. but first, before the new image images appear, I want to put an activity indicator, to show that images are loading instead of old images.
I want to add activity Indicator instead of image until image gets the load ..
My code ...
self.tableViewX = 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]; } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ { NSString *imageURL = [NSString stringWithFormat: @"www.xyz.image.png"]; cell.thumbnailImageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]]; });
Please help me with some sample code.
ios objective-c objective-c-blocks uiactivityindicatorview
Raju
source share