私の問題は、このボタンの下のアクションが完了したときにのみ画面から消える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];
}