As part of your custom table view cell, you should keep track of which row (or index path) your custom cell is currently displaying.
E.G. add two properties to the custom cell like:
@property (strong) NSIndexPath *currentIndexPath;
@property (weak) UITableView *parentTableView; // important, must be weak!
And then you can set it in your view controller's "cellForIndexPath:
" method like:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
...
myCustomCell.currentIndexPath = indexPath;
myCustomCell.parentTableView = tableView;
Now, in the same function where you update the image in your cell (and right after), you can reload the single cell by doing:
UIImage *image = //load image, it always return a value, never nil
if(image != nil){
self.iconCell.contentMode = UIViewContentModeScaleAspectFill;
self.iconCell.clipsToBounds = YES;
self.iconCell.image = image;
}
// reloading now should have the image properly set...
NSArray *rowToReload = [NSArray arrayWithObject:self.currentIndexPath];
[self.parentTableView reloadRowsAtIndexPaths:rowToReload withRowAnimation:UITableViewRowAnimationNone];
More information can be seen in this related question.