Warning:attempt to dismiss from view controller <UIViewController:0x17d71c10> when a presentation or dismiss is I N progress!

Source: Internet
Author: User

Yesterday debug program is almost on the line suddenly there is a bug found for a long time to find it is because of this warning but it took a day to solve the warning the various methods of eliminating the controller are not available

And with this bug, the real-world phone test is all right. There's a problem with this warning on the ipad.

The first solution tried to lower and lower the semi-finished code

Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (0.51 * nsec_per_sec)), Dispatch_get_main_queue (), ^{

if (![ Self.presentedviewcontroller isbeingdismissed]) {

[Self dismissviewcontrolleranimated:no completion:nil];

}

});

One of these 0.51 is actually a time interval but I tested it if it was set to 0.01 test 10 This bug will occur every time if 0.99 tests 20 times did not appear

Personally think that this number seems to be the probability of a percentage of the problem of the joy of throwing the interface to the game over there, say my side is the client finished to give the game to access under the test can use no I test can use

But a game on the other side of this method how to do it. Sometimes it is the first run can not run the third run again can, anyway is not find the law so this method for me or not

The second solution tried to completely use the upper and lower code

-(void) Viewdidappear: (BOOL) animated

{

[Super viewdidappear:animated];

[Self forcedupdateversionself];

}

That's right. Write the method you want to dismiss-(void) Viewdidappear: (BOOL) animated and I wrote

-(void) viewdidload, so it's always a mistake.

This error translates: Your view controller is still in the program and you are trying to erase your viewcontroller.

Understand that it should be your view has not been fully loaded successfully yet you have to eliminate the view so the computer may sometimes not understand what you want to do is to load or clear

Warning:attempt to dismiss from view controller <UIViewController:0x17d71c10> when a presentation or dismiss is I N progress!

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.