如何取消或暂停MKNetworkKit iOS的下载操作? [英] How to cancel or pause download operation of MKNetworkKit iOS?

查看:160
本文介绍了如何取消或暂停MKNetworkKit iOS的下载操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很熟悉iOS编程,只学了一两个月。
我的计划是从网站下载文件。
我正在使用MKNetworkKit并学习一下并进行测试。
我可以从网络下载文件,但我无法暂停或取消下载。
我查看了代码,但我不知道如何在下载过程中取消操作。
我想做的是创建一个取消按钮,当我点击它,它将触发IBAction取消下载过程。
另一步是暂停下载。

解决方案

您不能暂停请求。然而,您可以取消它,如果您的服务器支持Range标头,MKNetworkKit将自动恢复您的下载。


I am very new to iOS Programming and have been learning for only a month or two. My plan is to download files from websites. I am using MKNetworkKit and learning a little bit and testing it. I can download the file from the web but I cannot pause or cancel the download. I looked through the code but I don't know how to cancel the operation in the middle of the download. What I want to do is create a cancel button and when I hit it, it will trigger IBAction to cancel the download process. Another step is pause the download.

解决方案

You cannot pause a request. You can however cancel it and if your server supports Range headers, MKNetworkKit automatically resumes your download.

这篇关于如何取消或暂停MKNetworkKit iOS的下载操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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