Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-15-2009, 03:05 PM   #5 (permalink)
CanadaDev
Registered Member
 
Join Date: Mar 2009
Location: Toronto, ON
Posts: 111
Default

Quote:
Originally Posted by bharath2020 View Post
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.
CanadaDev is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 281
21 members and 260 guests
Aaronkwok963, alexy, bensj, bravetarget, BSDimwit, Chilibird, CHV, dre, Gudus, jamison, KyleTomson, LemonMeringue, mer, punknine, ronm3xico, sindhutiwari, SirGeraint, smasher, VMan, ybrikeeg, _nivek
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,225
Threads: 39,002
Posts: 171,083
Top Poster: smasher (2,570)
Welcome to our newest member, Aaronkwok963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:25 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.