0

When I scroll to new area of the UITableView with lazy image loading, then immdietly scroll back to the old area, no matter what I do now, the new area will not show new images.

My code is based on apple lazy table view.

Till now I thought it was something with the web server, but I had cache functionality now, and all images are loaded from iphone files, so for sure there is somthing wrong in my code.

Again, the images are not shown ONLY in that case :

  1. UITableView is loading the data

  2. All visible cell are showing the images correctly.

  3. If I scroll to new area, move to old area *quickly* and move back to new area the image will not load, no matter where I scroller now(only the images in the new area that I quickly scorll back from will not load)

  4. all on other cases, the images are shown correctly.

tex1001
  • 3
  • 1
  • Refer this link http://stackoverflow.com/questions/1130089/lazy-load-images-in-uitableview hope it helps.. – P.J Aug 14 '11 at 16:37

2 Answers2

0

Without seeing the some code its hard to say. If your display is tied to a callback from the NSURLConnection you might be losing your reference to the delegate.

When you scroll the cell view get repopulated with the data in the new cell. If the NSURLConnection is running outside of the cell view you might be losing the reference to it's delegate. When the NSURLConnection is completed if it doesn't have a delegate to fire the complete method then it won't get called. When you scroll to the new cell the NSURLConnection is already complete so it doesn't call the completed again and the spinner just keeps going.

puppybits
  • 1,110
  • 12
  • 16
  • I tested this again. I think if somthing with : if(!appRecord.m_imgImage) if(self.m_tableView.dragging==NO && self.m_tableView.decelerating ==NO) { [self statIconDownload:appRecord forIndexPath:indexPath]; } – tex1001 Aug 14 '11 at 23:43
  • meaning, for strange reason, the cells are was quickly shown for short time, and then scroll back to view them, only this cells have : dragging and decelerating =yes even when no scrolling, and this prevent from start downloading. very strange – tex1001 Aug 14 '11 at 23:52
  • ok, I got it, did not fix it yet, but the problem is in "loadImagesForOnScreenRow" and I don't remeber if this was on apple sample, but in this code if i have and image download already im not checking if it set to the cell.image. – tex1001 Aug 15 '11 at 00:15
0

I fix it. the bug was nothing to do with all above. so nothing to share and learn from. I thought it is important for other I'll be clear about that, so no one will be confused about what I wrote earlier.

The process of checking if image already download was wrong.

  • Can you use the same e-mail on this account as the one you used to ask? If so, I can easily merge your accounts and you'll be able to accept this as the answer to this question. – Tim Post Aug 15 '11 at 06:45