ASIHttpRequest 恢复下载
我有一个与这篇文章类似的问题 ASIHTTP 异步 pdf 下载
我要恢复下载使用 setTemporaryFileDownloadPath: 但奇怪的是,当我调用 setDelegate 到 self 并异步启动连接时,缓存不会将其保存到temporFileDownloadPath 但我注释了设置的委托,缓存将保存到该路径。
_conn = [[ASIHTTPRequest alloc] initWithURL:_currentURL];
[_conn setDownloadDestinationPath:_currentFileNameWithPath];
[_conn setTemporaryFileDownloadPath:tempPdfLocation];
[_conn setAllowResumeForFileDownloads:YES];
//[_conn setDelegate:self];
[_conn startAsynchronous];
我发现每当 - (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data: 被调用时,缓存都不会保存。有什么想法吗?
I've got question that similiar to this post ASIHTTP asynchrounous pdf download
I am going to resume download using setTemporaryFileDownloadPath: but the weird thing is when I called setDelegate to self and start the connection asynchronously, the cache won't save it to temporaryFileDownloadPath but instead I remark the set delegate, the cache will save to the path.
_conn = [[ASIHTTPRequest alloc] initWithURL:_currentURL];
[_conn setDownloadDestinationPath:_currentFileNameWithPath];
[_conn setTemporaryFileDownloadPath:tempPdfLocation];
[_conn setAllowResumeForFileDownloads:YES];
//[_conn setDelegate:self];
[_conn startAsynchronous];
I've found that whenever - (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data: was called the cache won't saved. Any Idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用的是同样的东西。唯一的区别是我必须设置以下选择器:
并且不实现 ASIHTTPRequestDelegate 协议中指定为可选的任何其他委托方法。现在下载工作正常,并且会在需要时调用设置选择器。
I used the same thing. Only difference is that I had to set the following selectors:
And not implement any of the other delegate methods specified as optional in the
ASIHTTPRequestDelegate
protocol. Now the download works perfectly and will call the set selectors when needed.