Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Getting Images Using Grand Central Dispatch - cache problem

Hello everyone! I'm proud to be a noob on Treehouse. I have a question regarding the Getting Images Using Grand Central Dispatch video. Are the images downloaded with Grand Central Dispatch being cached? I tried this on a project on my own (where the images are considerably bigger than the avatars used in the tutorial) and i get weird bugs like:

  • slow download
  • whenever i scroll fast in the UITableView and don't wait until the images load, when the download is finished, i get images inserted into wrong cells.

For example: Scroll to the middle and immediately scroll back up. The first cell will have the image that's corresponding to the middle cell that didn't get to finish loading.

2 Answers

I've made a suggestion in this other thread. Haven't tried it myself but in theory it should work with minimal code.

Thank you John!