image not showing in UIImage from cached data

76 Views Asked by At

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"]];
 }
1

There are 1 best solutions below

0
On

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