objective-c - iOS应用内置下载如何实现?(如图)
怪我咯
怪我咯 2017-04-17 17:00:00
0
1
286

这是一款旅游类APP的攻略内容,每个目的地的右上角都有一个下载标志,点一下就可以下载到本地数据库,可以离线查看,大概每个攻略内容有200M左右。

详情问这种功能如何实现,谢谢!

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
Ty80

If you simply implement the download function, then it is OK to request some resources from the server and get them directly.
It can be implemented from AFNetwork.
But general downloads have some additional processing, such as breakpoint resuming and so on.
Then you have to add the request header Set additional request information such as range etag.
In addition, the download is returned from the network thread, so the synchronization problem between the returned data and the data written to the file needs to be processed.
It is recommended that the returned data be written into NSOutputStream and then used to write the file using NSOutputeStream.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template