我想使用 ASIHTTPRequest 下载文件,方法如下:
ASIHTTPRequest *request;
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:downloadServer]];
[request setUserInfo:[NSDictionary dictionaryWithObject:@"download" forKey:@"download"]];
[request setDidFinishSelector:@selector(downloadIsFinished:)];
[request setDidFailSelector:@selector(downloadIsFailed:)];
[request setDelegate:self];
[request setTimeOutSeconds:40];
[request setDownloadProgressDelegate:self];
[request setShowAccurateProgress:YES];
[request startAsynchronous];
如果我在 Wifi 上一切都很好,但如果我在 3G 上,那么我的方法会尝试下载文件,但 10 秒后 downloadIsFinish 委托会触发,但我的文件实际上并没有被下载......