我想下载一个文件并显示
我能够做到这一点的进度条。
现在,我想在标签中显示进度值并使用此代码来进行初始化和更新标签:
[queue setDelegate:self];
[queue setRequestDidFinishSelector:@selector(updateLabel)];
[queue setDownloadProgressDelegate:progress];
[queue setShowAccurateProgress:YES];
ASIHTTPRequest *request;
request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request setTemporaryFileDownloadPath:[filePath stringByAppendingString:@".download"]];
[request setAllowResumeForFileDownloads:YES];
[request setDidFinishSelector:@selector(updateLabel)];
[request setDidReceiveDataSelector:@selector(updateLabel)];
[request setShouldContinueWhenAppEntersBackground:YES];
[request setShouldAttemptPersistentConnection:NO];
[request setDownloadDestinationPath:filePath];
[queue addOperation:request];
[queue go];
但不保存在目标路径中!
当我清除此代码时:
[request setDidReceiveDataSelector:@selector(updateLabel)];
保存完成!
什么是问题?
我想在进度值更改时更新标签文本