AFNetworking prefetch other images

a 夏天 提交于 2019-12-11 16:54:09

问题


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?


回答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.



来源:https://stackoverflow.com/questions/17244712/afnetworking-prefetch-other-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!