2011-09-18 166 views
0

是否可以在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]; 

如何恢復此下載是否可能?或者如何正確地暫停請求?

回答