我无法使用下面的代码从我的UIImageView
获取我从XML解析的图像。我做错了什么,因为我使用NSLog
检查了它是否显示是否有链接,显然有。
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];
}
我也尝试过以下代码,但它给了我一个错误。
if (cachedList != nil) {
cell.imageShow.image = [UIImage imageNamed:[cachedList valueForKey:@"imageURL"]];
}
答案 0 :(得分:0)
我认为如果您使用的是UITableView,那么这就是我用过的东西,我更喜欢tableview