NSData dataWithContentsOfURL cache

前端 未结 1 481
天涯浪人
天涯浪人 2021-02-08 16:18

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 fro

1条回答
  •  日久生厌
    2021-02-08 17:22

    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

    0 讨论(0)
提交回复
热议问题