Quote:
Originally Posted by ipodishima
So, i do like this : in - (UITableViewCell *)tableView  UITableView *)tableView cellForRowAtIndexPath  NSIndexPath *)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