0

我是 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];
}
4

1 回答 1

0
  1. 完成后,您必须手动关闭警报ASIHTTPRequestprogressView != progressAlert
  2. 不要使用ASIHTTPRequest
于 2012-02-03T21:16:52.743 回答