2013-10-29 159 views
0

點擊確定或取消按鈕UIAlertview工作正常。當我點擊確定或取消按鈕時,UIAlertview不會被解僱,但如果我點擊確定或點擊取消按鈕然後只有UIAlertview被解僱。UIAlertview在ios7中無法正常工作

這是我的代碼。

alert = [[UIAlertView alloc] initWithTitle:@"Plese Enter comma seperated sets" 
                  message:@"\n" 
                  delegate:self 
                cancelButtonTitle:@"Cancel" 
                otherButtonTitles:@"Save", nil] ; 
      CGRect rect = {12, 60, 260, 25}; 
      dirField = [[UITextField alloc] initWithFrame:rect] ; 
      dirField.backgroundColor = [UIColor whiteColor]; 

     alert.alertViewStyle = UIAlertViewStylePlainTextInput; 
     dirField.text = setString; 
     [dirField setText:@"test"]; 
     [dirField becomeFirstResponder]; 
     [alert addSubview:dirField]; 
     [alert show]; 
+0

它可能是你的代碼被調用兩次。把nslog檢查點擊按鈕 – Baddu

回答

1

Meghaji

我覺得有問題,你的方法,我的意思是它在調用2次。

謝謝

相關問題