在uialertview之后,故事板不会更改视图

时间:2012-08-30 17:36:03

标签: objective-c xcode ios5 uialertview

我在执行UIAlertView时遇到麻烦,(警报视图工作正常)但是......我无法将segue执行到另一个窗口......转换的类型是模态的...任何帮助?

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];
}

1 个答案:

答案 0 :(得分: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];

    }
}