Add an UIProgressView or UIActivityIndicatorView to your UIAlertView

This snippet shows how to add an UIProgressView to an UIAlertView.
You can choose to display an UIProgressView or an UIActivityIndicatorView in the alert.

This may break with a new version of the SDK (2.1 for now), but this was accepted by Apple (or they didnt see it)

- (void) createProgressionAlertWithMessage:(NSString *)message withActivity:(BOOL)activity
{
  UIAlertView *progressAlert = [[UIAlertView alloc] initWithTitle: message
                                             message: @"Please wait..."
                                            delegate: self
                                   cancelButtonTitle: nil
                                   otherButtonTitles: nil];

  // Create the progress bar and add it to the alert
  if (activity) {
    UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    activityView.frame = CGRectMake(139.0f-18.0f, 80.0f, 37.0f, 37.0f);
    [progressAlert addSubview:activityView];
    [activityView startAnimating];
    [activityView release];
  } else {
    UIProgressView *progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(30.0f, 80.0f, 225.0f, 90.0f)];
    [progressAlert addSubview:progressView];
    [progressView setProgressViewStyle: UIProgressViewStyleBar];
    [progressView release];
  }
  [progressAlert show];
  [progressAlert release];
}

Edit: corrected the code