我正在尝试使用以下代码从本地URL加载图像:
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:fileURL]];
[self.imageView setImage:image];
NSLog(@"imageView set");
我在控制台中看到 "imageView set" 的输出几乎是立即的,但它会花费很长时间才能在用户界面中反映出来(有时需要几分钟!)。
你有什么想法,为什么会发生这种情况呢?
fileURL
的值是什么?这个线程在运行什么? - Tim