"何かをする - > show alert1->何かをする - > show alert2"というコードを書く。iPhoneのAlertViewのバグ?
//do something
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Alert 1"
message:nil
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
//do something
UIAlertView *alert2 = [[UIAlertView alloc]
initWithTitle:@"Alert 2"
message:nil
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert2 show];
[alert2 release];
と、突然奇妙な複数のAlertViewsに起こった:それは "警告1" を示す - > "アラート2"(押して 'OK') - > "警告1"。なぜ "Alert 1"が再び表示されるのですか?私はまだデリゲートメソッドを書いていません。
alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndexはうまく機能します。デリゲートメソッドは、複数のalertViewを表示する一般的な方法ですか?
ありがとうございました。 alert1のキャンセルボタンは、alert2が表示されているときにブロックされます。これは私にそれをクリックする時間がない。デリゲートメソッドは常に複数のアラートビューを表示するために使用されますか? –
少なくともそれ以外の方法はありません – cobbal
UIAlertViewをモーダルで表示する方法がありますが、プライベートメソッドです – rpetrich