Menu

#649 Error message 'unbalanced animations' on startup

iphone_1.10
closed
nobody
None
5
2020-07-20
2020-07-19
No

During startup I see the following error message:
Unbalanced calls to begin/end appearance transitions for <uiviewcontroller: 0x7f8cfda04700="">.</uiviewcontroller:>

Possibly related to wrong usage of the UI restoration API?

Discussion

  • Christa Runge

    Christa Runge - 2020-07-19

    It happens between DBNavigationController.viewWillAppear and DBNavigationController.viewDidApear.

     
  • Christa Runge

    Christa Runge - 2020-07-19

    Suggestions from the internet:

    • an animation was started before the previous was finished
    • push / present / or pop operations on a view controller, or performing a segue from viewDidLoad or viewWillAppear. The correct time is viewDidAppear
    • same view controller pushed twice, or popped twice, or added twice to the view hierarchy
    • wrong / mismatching / missing calls of super for the view callback methods (-viewWillAppear, -viewDidAppear, -viewDidLoad, -viewWillDisappear, -viewDidDisappear )
    • present modal vc too early, before app is done initialising
    • not called the designated init method of a view controller
    • overridden shouldAutomaticallyForwardRotationMethods but not shouldAutomaticallyForwardAppearanceMethods in the window root navigation controller
    • custom animation has wrong order of beginAppearanceTransition and endAppearanceTransition on the entering and the exiting view controllers
    • You can add a breakpoint to -[UIViewController _endAppearanceTransition:]
     

    Last edit: Christa Runge 2020-07-19
  • Christa Runge

    Christa Runge - 2020-07-20

    Resolved in commit 8c5daee1a50ac296b64671d1c443a4e0633d182c.
    Solution: The order of instructions in startup was mudled up.
    The API documentation is a bit unclear here.
    http://aplus.rs/2013/state-restoration-in-ios-6-without-storyboards/ shows a nice and correct example.

     
  • Christa Runge

    Christa Runge - 2020-07-20
    • status: open --> closed
     

Log in to post a comment.