Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing ViewControllers to UINavigationController during an animated ViewController transition

I'm developing an application where different viewcontrollers are pushed onto a navigation stack when recieving either remote or local notifications.

The problem comes when the application is active and if a notification comes in between an animated viewcontroller transition. This messes up the navigationcontroller and i get the following error message:

nested pop animation can result in corrupted navigation bar Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

Is there some way to check if viewcontrollers are changing and if so wait until the transition is complete? Or is there perhaps some other methods of solving this problem?

As always, any help is greatly appriciated!

like image 923
Madoc Avatar asked Mar 08 '12 19:03

Madoc


1 Answers

There are some methods for getting the state of the viewController. Such as: (BOOL)isBeingPresented and (BOOL)isViewLoaded. I would look into the apple doc's on ViewControllers.

Also UINavigationController has a couple of methods also such as:

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
like image 109
Hubert Kunnemeyer Avatar answered Oct 04 '22 17:10

Hubert Kunnemeyer