UIAlertView appears twice , need ur help

public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            btnLogin.TouchUpInside += async (object sender, EventArgs e) =>  
            {

                await HttpServiceConn.WebRequestService(md5hash,"url");
                ShouldPerformSegue("fromLoginToGraphic", this);
            };

        }
        public override bool ShouldPerformSegue (string segueIdentifier, NSObject sender)
        {
            if (txtPassword.Text.ToUpper() == "Пароль".ToUpper() || txtPassword.Text.ToUpper() == "" || txtLogin.Text.ToUpper() == "Логин".ToUpper() || txtLogin.Text.ToUpper() == "") {
                UIAlertView error = new UIAlertView("Ошибка","Введите пожалуйста логин и пароль.",null,"OK",null);
                error.Show();
                return false;
            }
            return true;
        }

Code is working fine , but this alert make me insane

Posts

  • JeredMcFerronJeredMcFerron USMember

    Is it possible you're calling ShouldPerformSegue AND something in your storyboard is also calling ShouldPerformSegue?

  • NickolasShpotenkoNickolasShpotenko UAMember ✭✭

    Nope. I`m using segue identifier and nothing more calling SPS.

  • MikeGmnderMikeGmnder CHMember ✭✭

    Is the problem solved? I have the same problem..

  • NickolasShpotenkoNickolasShpotenko UAMember ✭✭
    edited November 2014

    Yes. It was just bad idea to call alert on perfomsegue.

    public override void ViewDidLoad ()
            {
                base.ViewDidLoad ();
                btnLogin.TouchUpInside += async (object sender, EventArgs e) =>  
                {
    
                    await HttpServiceConn.WebRequestService(md5hash,"url");
            if(true)
            {
                          ShouldPerformSegue("fromLoginToGraphic", this);
            } 
        }
    
Sign In or Register to comment.