2012-08-30 49 views
-2

我有麻煩時,我執行一個UIAlertView,(警報視圖工作正常)但是...我不能執行segue到另一個窗口...過渡的類型是模式.. 。有什麼幫助?故事板沒有改變視圖後uialertview

if([txtPeticion hasText]) 
{ 
    alertaVeladora = [[UIAlertView alloc] 
          initWithTitle:@"Santuario Virtual" 
          message:@"Gracias por compartir tu veladora!" 
          delegate:self 
          cancelButtonTitle:nil 
          otherButtonTitles:nil]; 

    [alertaVeladora show]; 
    [self postMessage:txtPeticion.text shareTw:shareTwitter shareFb:shareFacebook withEmail:email]; 
    txtPeticion.text = @""; 
    [self performSelector:@selector(dismissAlert:) withObject:alertaVeladora afterDelay:1.0f]; 
} 

回答

2

如果我理解正確,您想在用戶按下AlertView上的解除按鈕時執行segue嗎?要在按鈕被按下時執行動作,請使用以下代碼:

if([txtPeticion hasText]) 
{ 
    alertaVeladora = [[UIAlertView alloc] 
         initWithTitle:@"Santuario Virtual" 
         message:@"Gracias por compartir tu veladora!" 
         delegate:self 
         cancelButtonTitle:nil 
         otherButtonTitles:nil]; 

[alertaVeladora show]; 
} 

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
    if(alertView.tag == 1) 
    { 
     // Perform Segue 
     [self performSegueWithIdentifier: @"MySegue" sender: self]; 

    } 
}