我有2個警報在同一頁上。問題在於clickedButtonAtIndex正在回答兩個警報,而不僅僅是第二個警報。我如何區分它們?整理2 UIalertview的按鈕點擊
UIAlertView *passwordAlert = [[UIAlertView alloc] initWithTitle:@"Phone Number" message:@"\n\n\n"
delegate:self cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK",nil), nil];
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Warning" message:@"Please Enter correct phone no." delegate:self cancelButtonTitle:nil otherButtonTitles:@"Try Again", nil];
- (void)alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {
在第一個輸入電話號碼,然後點擊確定。如果驗證,很好。但是,如果它不顯示第二個警報。現在,當他們點擊「再試一次」時,clickedButtonAtIndex就會在第一次和第二次提醒時運行。我需要它只能在第二次運行。
真棒。謝謝我現在還沒有用到蘋果文檔。謝謝大家花時間回答。 – Rick