ASIHttpRequest resume Downloading
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];
开发者_StackOverflow//[_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?
I used the same thing. Only difference is that I had to set the following selectors:
[_conn setDidFailSelector:@selector(downloadDidFail:)];
[_conn setDidFinishSelector:@selector(downloadDidFinish:)];
[_conn setDidStartSelector:@selector(downloadDidStart:)];
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.
加载中,请稍侯......
精彩评论