0

I am using the UIImageView + AFNetworking category to download and display images from an array of URLs and populate a table view.

Now I find that the other images are delayed because only the current cell's image will be loaded. I need to keep busy by fetching other images as well.

My idea would be to write a for loop and start downloading and caching with AFNetworking, say, 10 other requests starting from current indexPath.

Or should I just do the usual dispatch_async in the completion block and start fetching the mentioned 20 other images?

Any better ideas?

esh
  • 2,842
  • 5
  • 23
  • 39

1 Answers1

1

In most cases, pre-fetching won't be nearly as beneficial as you might expect. On a mobile device, power and bandwidth are limited resources, which calls into question the value of loading things that a user may not actually ever see. You're most likely doing a disservice by trying to be clever about this.

mattt
  • 19,544
  • 7
  • 73
  • 84
  • 1
    Now, I believe that **questioning the value of loading things that a user may not actually ever see** is subject to interpretation and user experience. If I am scrolling through images, won't it be good if some of those images preloaded? The comments I receive from some users are like, what happened to the other images, and why aren't they loading? Of course now we can talk about mobile device limitations. But I would like to try (maybe fail). I tried, but it kinda sucks :P I am doing it wrong. – esh Jun 24 '13 at 05:26
  • Oh and by the way, you can see [this](http://stackoverflow.com/questions/15701556/sdwebimage-does-not-load-remote-images-until-scroll) link. – esh Jun 25 '13 at 12:50
  • @BlackFlam3 There are a thousand other things you can do to improve user experience in a more significant way. You're probably much better off spending your development time on something else. – mattt Jun 25 '13 at 16:01