Cruisehu
Cruisehu

Reputation: 343

navigationcontroller back to upper navigationcontroller

The question is show in the picture. How can I back from viewcontroller C to A. Method popViewControllerAnimated doesn't work.

enter image description here

Upvotes: 0

Views: 49

Answers (1)

tbaranes
tbaranes

Reputation: 3590

You have an issue in your controllers hierarchy. You shouldn't have an UINavigationController between your UIViewController A and C.

Since the UITabBarController push the controller A embedded in an UINavigationController, your navigation is already setup for this tab, no need to repush another one later.

So, to solve your issue, you should have that for the first tab: UITabBarViewController -> UINavigationController -> UIViewController A -> UIViewController C. This way, the popViewControllerAnimated will work.

Upvotes: 2

Related Questions