views:

88

answers:

2

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?

+1  A: 

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

Which kinds of data you want to get

UIImage : yes, I think you should use NSData

Video: you should use MPMoviePlayerController for streaming

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

vodkhang
I need to get configuration files in XML format, i should use NSUrlConnection, right?
cesarnicola
Yeah, I think you should use NSUrlConnection and do asyncrhonous to prevent blocking UI
vodkhang
+1  A: 

Use ASIHTTPRequest. It's a third party HTTP client library that makes network interaction MUCH simpler, and has very nice caching functions.

Dan Ray