iphone sdk: pausing NSURLConnection?

﹥>﹥吖頭↗ 提交于 2019-12-24 15:06:20

问题


In my app I give the user the ability to download files from a server. For that I use NSURLConnection. I would like to give the user the ability to pause and resume the download by tapping a button. I couldn't find any way to do this besides calling the cancel method and then creating a new NSURLConnection. So is there an elegant way to pause NSURLConnection?

Thanks


回答1:


That's the only method I'm aware of. If your server supports the "Range:" header, you can then create a new connection and have it pick up where the other one left off.



来源:https://stackoverflow.com/questions/2121096/iphone-sdk-pausing-nsurlconnection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!