Does the method popViewControllerAnimated: act different than the Back button of the NavigationController?

322 views Asked by At

In my Application i have a container ViewController which is the RootView of an UINavigationController.

I transit between various Child ViewControllers through a segmentedControl in the Toolbar of the UINavigationController.

One of the Child views pushes another View on the NavigationController, keeping the ToolbarItems.

Using the Back Button I get the desired behaviour of returning to the RootViewController, but any try of going back programatically won't change the view. popViewControllerAnimated always takes the topViewController of the Stack but nether updates the View. viewWillAppear of the Container ViewController won't be called this way. So i am wondering if the Back button does any additional Stuff which won't happen in with popViewControllerAnimated. Also popViewControllerAnimated:YES will freeze the app without throwing an error.

Thanks for the help in advance.

Edit: Ok one test case was a little of.

A popViewControllerAnimated in the topViewController of the Stack works as normal. But a call to popViewControllerAnimated through the SegmentedControll does not.

I realise the way i wrote this might be a little confusing, i will try to make this all a little clearer later.

1

There are 1 answers

0
PSchu On

Ok, it was a timing issue. I changed the ChildViews of the container ViewController directly after the call to popViewControllerAnimated.