恢复取消的 ASIHTTPRequest
是否可以在 ASIHTTPRequest 中恢复取消的下载?我使用以下代码下载文件:
NSURL *url = [NSURL URLWithString:urlString];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:url];
[request setTemporaryFileDownloadPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.download",fileName]]];
[request setDidFailSelector:@selector(requestDidFailed:)];
[request setDidStartSelector:@selector(requestDidStarted:)];
[request setDidFailSelector:@selector(requestDidFinished:)];
[request setAllowResumeForFileDownloads:YES];
[request setDownloadDestinationPath:path];
[request setShowAccurateProgress:YES];
[request startAsynchronous];
并使用以下代码取消:
[request cancel];
如果可能,如何恢复此下载?或者如何正确暂停请求?
Is it possible to resume canceled download in ASIHTTPRequest? I download file with this code:
NSURL *url = [NSURL URLWithString:urlString];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:url];
[request setTemporaryFileDownloadPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.download",fileName]]];
[request setDidFailSelector:@selector(requestDidFailed:)];
[request setDidStartSelector:@selector(requestDidStarted:)];
[request setDidFailSelector:@selector(requestDidFinished:)];
[request setAllowResumeForFileDownloads:YES];
[request setDownloadDestinationPath:path];
[request setShowAccurateProgress:YES];
[request startAsynchronous];
And cancel with this code:
[request cancel];
How to resume this download if it's possible? Or how to pause requests correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该网站可能会有所帮助,请向下滚动到“恢复中断的下载”部分。 http://allseeing-i.com/ASIHTTPRequest/How-to-use
This site might help, scroll down to the Resuming interrupted downloads section. http://allseeing-i.com/ASIHTTPRequest/How-to-use