【问题标题】:ASIHTTPRequest UIProgressView don´t workASIHTTPRequest UIProgressView 不起作用
【发布时间】:2012-02-02 19:38:19
【问题描述】:

我是 Xcode 的新手,对 UIProgressView 有疑问。 我找到了一些代码,但我不太明白。你能解释一下为什么UIProgressView在完成后没有关闭吗?

- (IBAction)Download:(id)sender
{
    NSURL *url = [NSURL URLWithString:@"http://db.tt/5WP2pia"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request setDelegate:self];
    [request startAsynchronous];
    progressView = [[UIProgressView alloc]
                          initWithFrame:CGRectMake(30.0f, 80.0f, 225.0f, 90.0f)];
    UIAlertView *progressAlert =
            [[UIAlertView alloc] initWithTitle: @"Download..." 
                                       message: @"Please wait..."
                                      delegate: self
                             cancelButtonTitle: nil 
                             otherButtonTitles: nil];
    [progressAlert addSubview:progressView];
    [progressView setProgressViewStyle: UIProgressViewStyleBar];
    [request setDownloadDestinationPath:@"/var/root/osk.rar"];
    [request setDownloadProgressDelegate:progressView];
    [progressAlert show];
    [progressAlert release];
}

【问题讨论】:

    标签: ios progress-bar asihttprequest uiprogressview


    【解决方案1】:
    1. 您必须在ASIHTTPRequest 完成后手动关闭警报。 progressView != progressAlert
    2. 不要使用ASIHTTPRequest

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多