Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-07-2010, 11:53 PM   #11 (permalink)
shahab74
Registered Member
 
Join Date: Feb 2010
Posts: 82
shahab74 is on a distinguished road
Default Asynchronous Loading

Quote:
Originally Posted by ipodishima View Post
So, i do like this : in - (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath .


Code:
// Asynchrone View yipi
	AsyncUIImageView* asyncImage = [[[AsyncUIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)] autorelease];
    asyncImage.tag = 999;

	if([imageDict objectForKey:[[xmlParser.stories objectAtIndex:storyIndex] objectForKey:@"title"]])
	{
		// load from dict, ie cache	
		asyncImage = [imageDict objectForKey:[[xmlParser.stories objectAtIndex:storyIndex] objectForKey:@"title"]];
	}
	else {
		// load photo from web
		[asyncImage loadImageFromRawURLMadeOfString:[[xmlParser.stories objectAtIndex:storyIndex] objectForKey:@"article-body"]];
		// add into the dict
		[imageDict setObject:asyncImage forKey:[[xmlParser.stories objectAtIndex:storyIndex] objectForKey:@"title"]];
	}
with a NSMutableDictionary, of course.

I have to improve how i put the photo into the dictionary, because if i save into a .plist, i don't want to save all the photos ^^

++
Hi did you end up implementing the solution for it?I am facing the same issue but I am very new to iphone dev so if you could please give me some directions that be great.I am using the same code but everytime I scroll the already downloaded images are downloaded again.There are hundreds of posts and request about it but no one seems to have any solution.So If you have achieved this could you please let me know.
many thanks
shahab74 is offline   Reply With Quote
 

» Advertisements
» Online Users: 380
19 members and 361 guests
askb, Chickenrig, CMSLdesign, dre, guillermotricia, ilmman, jaychoupham, LEARN2MAKE, n00b, NSString, Paul Slocum, pbart, roof44, ryantcb, Speed, spinyanteater, teebee74, Trickphotostudios, waterkamp
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,591
Threads: 94,083
Posts: 402,777
Top Poster: BrianSlick (7,990)
Welcome to our newest member, guillermotricia
Powered by vBadvanced CMPS v3.1.0

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