-2

我在执行 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];
}
4

1 回答 1

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

    }
}
于 2012-08-30T17:55:46.117 回答