0

I cant possibly get the image that i parsed from the XML to show on my UIImageView using the code below. Am I doing something wrong because I checked it using NSLog to show if there is a link and apparently there is.

NSString *imageURL = [currentData.imageLink];
NSLog(@"this is link = %@", imageURL);
[cachedList addObject:imageURL];
[myCache setObject:cachedList forKey:@"imageURL"];
cachedList = [myCache objectForKey:@"imageURL"];  /where cachedList is NSMutableArray

for(id obj in cachedList){
    NSLog(@"value = %@", obj); //to show value
    cell.imageShow.image = [UIImage imageNamed:obj];
 }

and also I tried doing the below code, but it gives me an error.

 if (cachedList != nil) {
     cell.imageShow.image = [UIImage imageNamed:[cachedList valueForKey:@"imageURL"]];
 }
Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33
Ace Munim
  • 325
  • 3
  • 18

1 Answers1

0

I think if you are using UITableView then this is the thing i have used and i prefer for tableview

Link: https://github.com/jakemarsh/JMImageCache

Amar
  • 13,202
  • 7
  • 53
  • 71
Sarfaraz Khan
  • 572
  • 7
  • 20