1
我有以下代码忽略对setImage图像缓存:
NSString *myPath = [NSString stringWithFormat:@"../Documents/%@",@"bla.png"];
[imgView setImage:[UIImage imageNamed:myPath]]; // works fine
[self updateMyImage:[UIImage imageNamed:myPath]]; // loads another image as bla.png (works fine)
[imgView setImage:[UIImage imageNamed:myPath]]; // displays the old image, *not* the new one
的图像在updateMyImage加载:(我打开它(从模拟器的盘),它是“新”一个) 但imgView显示“旧”一个。我想它是一个缓存问题。由于iOS已经加载了[UIImage imageNamed:@"bla.png"]
一次,它认为这是同一个。如何“刷新”缓存并告诉它重新加载图像?
Gr8!有效。谢谢。 – Georgia