在我的应用程序获得服务器响应之前,我在警报视图中有活动指示器。该应用程序将数据发送到服务器,并且警报视图显示,当服务器向我发送响应时如何关闭它。这是我的警报中的代码
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Canceling reservation" message:@"please wait" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
[alert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// Adjust the indicator to place at the bottom of the dialog window.
indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height-50);
[indicator startAnimating];
[alert addSubview:indicator];