Quote:
Originally Posted by bharath2020
Where exactly do you invoke setCelllImageURL:?
If its in the tableview delegate method objectforcellatrow.. then i suppose it is the wrong place..
|
It's invoked in cellForRowAtIndexPath: in my tableviewcontroller class.
Quote:
A simple solution is
Create a own ImageCache class (it will be handy in your future projects, as it has helped me a lot)
provide a request method to other classes
Use an queue internally to maintain and process the request,
the request should contain the url, the sender object(object responsible to received the image after loading) and some context info to return back to the caller...
process each request in a separate thread
once the request is processed(i.e. image is loaded) then inform the sender object along with context info
now store the image in the cache (either a mutable dictionary or array) through which you can fetch the image if requested in future..
you can check for the size of total images and keep a constraint on the total size of the cache
(Sender object in your case would be your UITableViewController or the appropriate class)
Hope that explains well..
|
Okay, I'll look into this. Find it odd there's no code available that already has all this stuff setup. I mean it's a pretty common thing, and a lot of apps use it. Haven't found a complete code only small pieces here and there.