0

我正在一个单元格中使用 ASIHTTP 库下载多个文件,并显示多个进度和状态,如接收到的字节等ASIHTTPRequest 块。请帮帮我

提前致谢

4

1 回答 1

0

您只需导入所有 ASIHTTPRequest 库,当您使用进度条并使用下面的内置方法时,您需要使用协议文件导入...

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString *url=@"http://dulemba.com/Visits/Cover-GGCC(2mb).jpg";

    proTo = [[protocol_file alloc]initWithURL:[NSURL URLWithString:url] delegate:self];




    imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 10, 300, 250)];
    [self.view addSubview:imageView];
    lbl=[[UILabel alloc]initWithFrame:CGRectMake(0, 250, 200, 100)];
    [self.view addSubview:lbl];
    lblPers=[[UILabel alloc]initWithFrame:CGRectMake(100, 250, 200, 100)];
    [self.view addSubview:lblPers];
    progressBar = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 280, 300, 90)];
    [self.view addSubview:progressBar];



  }

-(void)imgDownload:(UIImage *)data{
     imageView.image=data;
   NSLog(@"image");}
-(void)setLblvalue:(float)val{
     lblPers.text=[[NSString alloc]initWithFormat:@"%0.2f %%",val];
     }
-(void)setProgValu:(float)val{
 progressBar.progress=val;

// NSLog(@"进度 %f",val); }

-(void)setPersent:(float)val{
     lbl.text = [[NSString alloc] initWithFormat:@"%0.2f MB",val];
}
于 2014-03-27T06:40:59.260 回答