Skip to content

Instantly share code, notes, and snippets.

@piaoapiao
Created August 14, 2012 02:37
Show Gist options
  • Save piaoapiao/3345864 to your computer and use it in GitHub Desktop.
Save piaoapiao/3345864 to your computer and use it in GitHub Desktop.
下载一个文件进度显示
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[[NSURL alloc]initWithString:@"http://pic10.nipic.com/20101103/3970232_071442037843_2.jpg"]];
NSLog(@"path:%@",NSHomeDirectory());
[request setDownloadDestinationPath:[NSHomeDirectory() stringByAppendingPathComponent:@"1.jpg" ]];
request.delegate = self;
request.downloadProgressDelegate = self;
[request startAsynchronous];
}
- (void)setProgress:(float)newProgress
{
NSLog(@"progress:%f",newProgress);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment