NSData dataWithContentsOfURL缓存 [英] NSData dataWithContentsOfURL cache

查看:527
本文介绍了NSData dataWithContentsOfURL缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NSData + dataWithContentsOfURL默认有任何缓存吗?
有没有人用这种方法试验过某种问题,从网上获取数据的最有效方法是什么?

NSData +dataWithContentsOfURL has any kind of caching by default? Has anyone experimented some kind of problems using this method, what is the most efficient way to get Data from the web?

推荐答案

文档没有说它会缓存,所以我认为我们应该假设它们不进行任何缓存。

The documentation doesn't say that it will cache, so I think we should assume that they don't do any caching.

您想获得哪种数据

UIImage:是的,我认为你应该使用NSData

UIImage : yes, I think you should use NSData

视频:你应该使用MPMoviePlayerController进行流式传输

Video: you should use MPMoviePlayerController for streaming

文字:我认为你可以做正常的 NSUrlConnection 。它还具有异步,同步和缓存

Text: I think you can do normal NSUrlConnection. It also has asynchronous, synchrnous and caching

这篇关于NSData dataWithContentsOfURL缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆