【问题标题】:Storyboard does not changes the view after uialertview故事板在 uialertview 之后不会更改视图
【发布时间】:2012-08-30 17:36:02
【问题描述】:

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

【问题讨论】:

    标签: objective-c xcode ios5 uialertview


    【解决方案1】:

    如果我理解正确,您想在用户按下 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];
    
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-02
      • 1970-01-01
      • 2014-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多