【发布时间】:2012-04-30 14:22:41
【问题描述】:
我目前正在使用保存在 Core Data 对象中的二进制数据来生成 UIImage,如下代码。
UIImage * postImage = [UIImage imageWithData:image];
double imageRatio = postImage.size.height / postImage.size.width;
[imageContent setFrame:CGRectMake(imageContent.frame.origin.x, imageContent.frame.origin.y, imageContent.frame.size.width, imageContent.frame.size.height * imageRatio)];
[imageContent setImage:postImage];
但是,我发现生成图像时有点慢。
从服务器检索数据时,我应该在本地保存图像吗?
哪种方式更快?
谢谢,
【问题讨论】:
-
看看这个,这篇文章会对你有所帮助 - stackoverflow.com/questions/2573072/…