I am currently working on MGSplitViewController .So in this custom
split view controller the root view controller is already present in side a navigation controller (MainWindow.xib) but my main aim is to get the MGSplitViewController working with a NavigationController in the details side also?
How can i do it, can anybody able to achieve this ?
I do that in one project.
Put a UINavigationController into MainWindow.xib and have it contain your normal detail controller. (You can either configure the detail controller directly or tell it to reference another xib file.) Link the detailViewController outlet in MGSplitViewController to your detail navigation controller.
Let me know if some part of that is giving you trouble.
Try this APSplitViewController project from SlavaBushtruk's github.
This will anwser to your requirement.
Thanks
Related
I am a newbie to iPhone app development. I want to make a simple app using view-based template which will have a main menu (home screen) linking to different modules of the app. Modules will themselves be made up of either UINavigationController or UITabController.
First I just wanted to create and bug a module, so I took a NavigationController in MainWndows.xib(appDelegate) and stacked(linked) many ViewControllers to it.
Now I need to have main menu at start of app, where I have placed NavigationController. I am now confused what to do? I have got solution in my mind that place this NavigationController in new xib file and a mainMenuViewController in MainWindow.xib file and access navigation module as a modal. So my Question is that if my approach is right? How will I access this modal controller to push viewcontrollers onto it? Or is there other alternate for what I want..?
I hope my Question is clear...
Any suggestion or link is appreciable.
I have got a better idea in my mind. I am going to stick with NavigationController in MainWindows.xib. I will push Main Menu as Root view Controller with both its navigation bar and toolbar hidden. Depending upon the button tapped, I will further push appropriate View Controllers on NavigationController.
I am trying to develope an iPhone App for 3 months.
I found everything myself in books or the internet. Now I have a problem that I am not able to solve myself.
I would like to develope a tabbar application with 3 tabs.
In each tab is a navigation controller with a tableview.
The tableview loads the data from an XML file on the web. The difference between each tab is only the difference XML-url. The tableview and function should everywhere the same.
What have I done?
Created a tabbar application
Put 3 Navigation Controller in the Tab Bar Controller in the MainWindow.xib
Every View in each Navigation Controller points to the same "TableView" class
Now it loads on every tab the same tableview. But I just want to change the XML-URL which is loaded. But I dont know how to implementate this.
I hope that somebody can give me a hint? Thank you!
Are you sure you need a Tab Bar? You could just add an additional level of navigation on top for the sources. So your navigation controller stack would be like
UINavigationController -> SourceViewController -> ListViewController -> rest of your navigation stack.
ListViewController is a subclass of a UITableViewController which is passed the source url based on selection from SourceViewController which can be a subclass of UITableViewController too. This will save you of the repetition you are trying to avoid and is more likely a better option for the thing you need.
Now if you insist on using a Tab Bar, your stack will be more like –
UITabBarController which will have three instances of UINavigationController each with its own instance of ListViewController which like before will be initialized using a source url.
Now it may be smarter to reduce it to a single ListViewController and attaching all the navigation controllers to it. You can do this using the -tabBarController:didSelectViewController: method in the tab bar delegate. On every tab change/call, you clear the current cache that is providing data to the table view and load the appropriate cache based on the source XML of that tab.
Usually state is preserved on tab changes but using this structure you will have to do additional work to get that.
hi
i am currently working in iphone navigation based application. so my app have 30 screen,after navigating five screen i need a TabbbarController . I add tabbar Controller OverMy viewController ( [self.View addSubView:tab.View];) my application work fine and navigation work perfect but my problem is that after navigating from tabScreen to other myViewController which inside tabbbar controller are not relaods but navigated view controller work fine .
so above my code adding tabbar is wrong then plz help me ,thanks in advance.
I have to say, that I don't fully understand your question, I guess this is due to the language barrier, but maybe you can elaborate your explanation a little more. However, I think that I understood your problem. You want a UITabbarController (respectively it's view) to be a subview of a UINavigationController. Is that correct?
The answer to this question is simple, but, I'm afraid, unsatisfying your you: You can't do that and even if you could, you shouldn't. Please have a look at Apple's excellent ViewController guide. It says:
Thus, a navigation controller can incorporate custom view controllers, and a tab bar controller can incorporate both navigation controllers and custom view controllers. However, a navigation controller should not incorporate a tab bar controller as part of its navigation interface. The resulting interface would be confusing to users because the tab bar would not be consistently visible.
I have an app where the appDelegate has a UITabBarController. Each of the tabs has a navigation controller which I currently use to push a single detail view onto the stack in each tab. I am hoping to replace my navigation controller on each of the tabs with a splitViewController. I use the Interface builder to provide the UINavigationController for each tab. I am having trouble loading a nib for each tab that has a UISplitViewController in it. I am getting an instance of the UITableViewController class displaying on the screen, but I am not getting the UISplitviewController or the Popover or the detail view etc. These classes are all working in a standalone app, but I am not able to get them into each of the tabs in one app. Although I am currently using the Interface Builder I am open to doing this programmatically. If someone has suggestions, or an example small project of a Tab based app with individual split views in the tabs I would appreciate it very much. (As this is my first question I am not sure how much code or other pictures from IB would be helpful for me to post. If you need further detail please let me know and I would gladly amend this post.)
Apple documentation
"The split view controller’s view should always be installed as the root view of your application window. You should never present a split view inside of a navigation or tab bar interface."
Moving on...
Not only shouldn't you -- if you do so, an error is thrown when you run. It's impossible.
I am sure this is very simple, yet I am stuck...
I have created an application and added UITabViewController (dragged in from the library in Interface Builder. My application has 3 different views, clicking on appropriate tab brings the different view. So far so good.
I want to convert one of the views to be a UINavigationController: basically a table with the option to delete rows (so UINavigationController would need to have a button "Edit" on top).
I saw many samples which would do either 1 or 2, but not both.
How would I combine it, keeping in mind that I have used provided UITabViewController and did not added UITabBar directly to the view.
Thanks
If you are using Interface Builder, you should be able to just drag and drop a navigation controller into your tab bar controller as a child controller. The next tab bar item should be generated for it automatically from that.
You can also do this programatically by just creating however many UINavigationControllers you need in an array and assigning that to the uitabbarcontroller appropriately.
I actually don't like this method of combining the UINavigationController and UITabBarController since the tab bar controller must always be visible, which can be really confusing sometimes.
Instead, I recommend you make your own custom UITabBarController (Tab bar controller inside a navigation controller, or sharing a navigation root view) which you add to the navigation controller. I personally don't know why Apple didn't do this; hopefully this is the standard way in 4.0 :)