我的问题是我有一个 ActionSheet,只有当此按钮下的操作完成时,它才会从屏幕上消失。我的问题是我想在我的操作表中单击“保存”,然后关闭操作表,然后显示一些警报,通知用户等到保存完成。目前它的工作方式不同:首先显示操作表,然后在操作表下保存消息,最后从视图中删除操作表..因此用户看不到任何警报消息。
如何在 xcode 之前解除 actionSheet?
sheetActionButton下的方法:
- (IBAction)saveAction:(id)sender
{
UIAlertView *alert;
alert = [[[UIAlertView alloc] initWithTitle:@"Saving photo to library\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
[alert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
[indicator startAnimating];
[alert addSubview:indicator];
[indicator release];
[self saveImageToCameraRoll];
[alert dismissWithClickedButtonIndex:0 animated:YES];
}