Re:Automatic Remote Image Loading In an iOS Table View Contr...
by andwang on Thursday July 12, 2012 @07:01PM
(#4237316)
I have not seen SDWebImage. From what I can recall about AFNetworking (a fantastic library, by the way), it provides a category on UIImageView whose methods can download and display web images. I don't think it provides any help for loading images in a UITableViewController context. In other words, the app developer still needs to state what URL to load and when to load the images. With PFQueryTableViewController, you just state which image each cell should load, and the loading is managed by the controller.
[ Parent
| on HN ]
Re:Automatic Remote Image Loading In an iOS Table View Contr...
by jazzychad on Thursday July 12, 2012 @07:25PM
(#4237399)
SDWebImage provides a nifty category extension UIImageView+WebCache which provides a setImageWithURL:placeholderImage: method on UIImageViews and uses the SDWebImageCache to cache the images locally for you. It is excellent and I use it everywhere.
AFNetworking provides a similar category extension, but there is no obvious way to make it use an ondisk cache that survives app restarts, so its caching is not as useful as SDWebImage's.
Re:Automatic Remote Image Loading In an iOS Table View Contr...
by matthavener on Thursday July 12, 2012 @08:50PM
(#4237660)
I could be wrong, but as of iOS5, NSURLConnection does disk caching by default, and therefore so does AFNetworking. Source: http://petersteinberger.com/blog/2012/nsurlcache-uses-a-disk...
Re:Automatic Remote Image Loading In an iOS Table View Contr...
by jazzychad on Thursday July 12, 2012 @09:44PM
(#4237811)
Yes, There is disk caching for NSURLConnection by default, but in my experience it does not cache it across app restarts, so each time the app starts again all the images have to be fetched all over again... SDWebImage gives the persistent disk caching I want.
If I'm misunderstanding what's happening please let me know...
Re:Automatic Remote Image Loading In an iOS Table View Contr...
by matttthompson on Thursday July 12, 2012 @09:52PM
(#4237839)
NSURLCache does disk caching in iOS 5 and up, but only for http (no https) requests. Use SDURLCache if you want more options there.