繁体   English   中英

在iPhone中从远程服务器缓存图像

[英]Caching Images From Remote Server in iphone [closed]

嗨,我有一些图像存储在缓存中。 我需要将缓存图像存储在目录中。

我尝试了以下方法EgoImageview和以下两种方法

- (UIImage *) getImage: (NSString *) ImageURLString;
- (void) cacheImage: (NSString *) ImageURLString;

但是在这种情况下,缓存无法正常工作

以下是cache image fn的代码

请给我一些更好的方法

尝试这个 -

NSString *imgURL = @"imagUrl";

NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:imgURL]];

[imgView setImage:[UIImage imageWithData:data]];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM