Unbalanced calls to begin/end appearance transitions for

后端 未结 22 1958
长情又很酷
长情又很酷 2020-11-28 19:23

I read SO about another user encountering similar error, but this error is in different case.

I received this message when I added a View Controller initially:

22条回答
  •  暖寄归人
    2020-11-28 20:17

    Another solution for many cases is to make sure that the transition between UIViewControllers happens after the not-suitable (like during initialization) procedure finishes, by doing:

    __weak MyViewController *weakSelf = self;
    dispatch_async(dispatch_get_main_queue(), ^{
        [weakSelf presentViewController:vc animated:YES];
    });
    

    This is general for also pushViewController:animated:, etc.

提交回复
热议问题