Automatic Login Login Success The alert mask has been a bug

Source: Internet
Author: User

When the landing is done manually, Mbprogresshud message:@ "successful Landing"
And then Dispatch_after call Mbprogresshud Hidehud hidden can be successful.
The problem came, wrote the automatic login, nsuserdefaults configuration, and then [self login] login, can push the next controller, but the successful landing of the mask has been, will not be canceled. In the "Mbprogresshud Hidehud" method there to break points, still. Why is this?

Landing success the alert has been

Manual login Code No problem automatic login login successful after the cover cancel not lost login to the homepage has always been the Chrysanthemum interface ...

If you put the hidden method outside the dispatch is no problem.

The first time you run, turn on the automatic login switch, ShowMessage normal display for 1 seconds and then disappear. The second run, preference storage of the status of automatic login, directly logged in, and then the problem, login successfully jump to the next controller, ShowMessage did not disappear

1 //Login Verification Manual Connection Login2contac2-(ibaction) Loginsclick {3     //Login Failure Use official, self-written, third-party framework prompts the user not to apply the box warning4     if(! [Self.accounField.text isequaltostring:@"DJ"]) {5[Mbprogresshud ShowError:@"user name does not exist! "];6         return;7     }8     //Online verification of account data9     if(! [Self.pwdField.text isequaltostring:@"123"]) {Ten[Mbprogresshud showsuccess:@"Wrong password! "]; One         return; A     } -     //Add (Mask) cover screen -[Mbprogresshud ShowMessage:@"Program Ape is desperately loading data ..."]; the     //send a network request -      -     //analog Networking Fetch Data delay 1 sec dispatch_after snippet-gcd -Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0* nsec_per_sec)), Dispatch_get_main_queue (), ^{ +         //Remove Masks - //[Mbprogresshud Hidehud]; +[Self Performseguewithidentifier:@"Login2contac"Sender:nil];//Manual Jump A         //Save personal preferences for next automatic login atNsuserdefaults *defaults =[Nsuserdefaults standarduserdefaults]; - [Defaults setObject:self.accounField.text forkey:djaccount]; - [Defaults setObject:self.pwdField.text forkey:djpwd]; - [Defaults setBool:self.rememberPwd.isOn forkey:djrementpwd]; - [Defaults setBool:self.automaticPwd.isOn forkey:djautologin]; - [Defaults synchronize]; in     }); -     //cover has always been there only to remove masks here to [Mbprogresshud Hidehud]; +}

Automatic Login Login Successful The alert mask has been bug

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.