0
votes

Process

I am using storyboard, navigation controller in iPhone application. Then navigate it to another view where I have used Tabbar controller. Then in Tabbar controller, I've 3 tabs and each of them have their separate navigation controllers.

Now, After completed process. But when I navigate to Root, it does back with its own navigation controller inside of Tabbar controller.

Actually, I want to come back on main Navigation Controller of an application where application starts.

Basic Flow :: Main Window -> Navigation Controller -> Tabbar Controller -> Navigation Controller -> Button..

So by clicking on Button -> Back to Main Window... Any Idea to back to main root view.

But I'm stuck with this issue for navigation controller that can't back me to the application root.

Can anyone solve this issue? Please tell me ASAP.

Thanks in advance.

2
Share some code for back procedure that you have tried...Vishal
I've used :: [self.navigationController popToRootViewControllerAnimated:YES];MS.
It'll get me back to the navigationbar of tabbar (Tabbar controller showing in image).. But I want to back at (Main Page showing in image)MS.
Try this:[self.navigationController popViewControllerAnimated:YES];Vishal
Flow :: Main Window -> Navigation Controller -> Tabbar Controller -> Navigation Controller -> Button... So by clicking on Button -> Back to Main Window... Any Idea to back to main root view.MS.

2 Answers

0
votes

Not really the answer you're looking for, but FWIW:

You should avoid hiding tab bar controllers inside other controllers so that the tab bar controller appears and disappears. This isn't how they are meant to be used. They're supposed to be a main part of the UI and if I see a tab bar controller I expect it be there at the heart of the UI, controlling access to the main parts of the UI, and visible pretty much all of the time if not all of the time.

Don't take my word for it, listen to Apple:

Appearance and Behavior

A tab bar appears at the bottom edge of the screen and should be accessible from every location in the app. A tab bar displays icons and text in tabs, all of which are equal in width and display a black background by default. When users select a tab, the tab displays a lighter background (which is known as the selection indicator image) and its icon receives a blue glow.

Don't be terribly surprised if your app gets bounced from the app store for ignoring the human interface guidelines!

0
votes

It's resolve with ::

[self.parentViewController.navigationController popToRootViewControllerAnimated:YES];

Enjoy coding..!!