1

I'm having an issue where my UITableViewCell's image (I customized it into a cell with just the image) is not showing up after being downloaded unless you have scrolled down to make it invisible and scroll up to see again.

I am using HJCache for asynchronous image downloading as well as caching. What I am not sure is if this was the issue with HJCache or my UITableViewCell and how to fix it.

Ye Myat Min
  • 1,429
  • 2
  • 17
  • 29

4 Answers4

1

When the image has finished downloading (assuming the cell itself is the delegate for the asynchronous call), call [self setNeedsDisplay] which will redraw the cell. This is what happens when the cell is reloaded because of scrolling.

Accatyyc
  • 5,798
  • 4
  • 36
  • 51
1

Well, I'm just going to answer my own question since I had found the most ridiculous solution.

After trying out various methods and headaches, I deleted the app ( + cache) from the simulator and everything seems to be working properly again.

My best guess is that the locally stored unfinished images by HJCache were messing up.

Ye Myat Min
  • 1,429
  • 2
  • 17
  • 29
0

As soon as your data is finished loading, call [tableView reloadData]; This will make the tableView reload all of it's cells that are currently visible.

Aurum Aquila
  • 9,126
  • 4
  • 25
  • 24
0

When you set up the cell set the image to nil. If that doesn't work set the image to a default locally stored image of the same size web if it's just completely white.

Jonathan.
  • 53,997
  • 54
  • 186
  • 290