我想使用执行多个下载过程,ASIHTTPRequest
并且我已经使用代码实现了
编辑:
- (void)download{
UIImageView *image = (UIImageView *)[mainView viewWithTag:selectedTag];
for (UIProgressView *currentProgress in [image subviews]) {
if ([currentProgress isKindOfClass:[UIProgressView class]]) {
if(currentProgress)
{
currentProgress.progress = 0.0;
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:[urlArray objectAtIndex:selectedTag]]];
request.delegate = self;
[request setDownloadProgressDelegate:currentProgress];
[request setShowAccurateProgress:YES];
[request shouldContinueWhenAppEntersBackground];
[request allowResumeForFileDownloads];
[request startAsynchronous];
}
}
}
}
- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(progressUpdate:)
name:@"ProgressNotification"
object:nil];
}
这工作正常,现在我想继续这个过程,即使我导航到另一个viewcontroller
,而不用暂停或取消当前下载的UIProgressView
进度。
请帮忙。