I have a table that displays images. It can be searched live, which adjusts the cells being displayed. The images are loaded in the background using a concurrent NSOperation
subclass over the network when the image is not already immediately available.
After the image has been fetched, I want to update the table to display it.
How can I update the right cell?
- I cannot rely on the cell that I have built in
tableView:cellForRowAtIndexPath:
, because the cell may have been repurposed for another row. - I cannot rely on the
indexPath
passed intotableView:cellForRowAtIndexPath:
, because it may have changed since the update began due to a search term change. - I cannot search the visible cells in the table, because the cells themselves are instances of
UITableViewCell
and have no metadata. - I cannot search my filtered list, because I don't know what table to apply the changes to.
What am I missing?