Unbalanced calls to begin/end appearance transitions for

后端 未结 22 1978
长情又很酷
长情又很酷 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:19

    Without seeing more of the surrounding code I can't give a definite answer, but I have two theories.

    1. You're not using UIViewController's designated initializer initWithNibName:bundle:. Try using it instead of just init.

    2. Also, self may be one of the tab bar controller's view controllers. Always present view controllers from the topmost view controller, which means in this case ask the tab bar controller to present the overlay view controller on behalf of the view controller. You can still keep any callback delegates to the real view controller, but you must have the tab bar controller present and dismiss.

提交回复
热议问题