Moving a 'UITabBarController with UINavigationController' iPhone app to 'UITabBarController with UISplitView' on iPad - iphone

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.

Related

XCode 4.1 - Multiple view within a XIB

I have created an application successfully and given it a TabBar view controller that is working as i had hoped, but have run into a glitch.
On each xib i load from the tabBar I need to create sub-views that will perform tasks as this interacts with a database (or .. will). I have created my first page and the buttons that will navigate to the views within the XIB, but do not yet nkow how to navigate between views within the XIB itself.
would it be better to have seperate XIB's that load when the buttons are hit?
OR
should i create views within the XIB's for each category and switch between them?
I am still learning and have had some confusion regarding navigation as I already have the TabBar controlling the root of the application. I have been looking for tutorials, but they all seem to start at either navigation controller as the root, TabBar as the root, and nothing like I need for option 1 above.
I can add details of the app if needed, but am looking for guidance for now.
Thank you,
Silver Tiger
To navigate between views the best way is to use a navigation controller pushing/popping separate view controllers, loaded from separate nibs. UINavigationController is a subclass of UIViewController, so you can perfectly put a navigation controller for each tab. You can also use story-boarding in the new xcode 4.2, but I recommend getting comfortable with this before doing so.

Tabbar with different Data

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.

UISplitViewController Full Screen For Detail View

I have a uisplitviewcontroller which loads a UIWebView as its detail view. I would like to allow the use to hide the RootViewController so that they can use the detail view controller in full screen.
The behavior is similar to that used by the Dropbox application. I'm not sure how to get this done. I've tried creating a new view controller and copy the webView, but there are issues whenever the user zooms the web view.
You can customize the default split view only to a certain level..
Here are some related questions from SO:
Hiding master view in split view app..???
Ipad Split view controller
but i think you've already read them.
I would suggest you to create your own custom controller as the default split view has very limited functionality.
You can look at MGSplitViewController. It is a really good custom implementation similar to the UISplitViewController with much more flexibility.

UINavigation controller problem

I'm developing an iPhone application and I'm trying to do this:
I want an application with tree views. The view shown first, doesn't have a navigation bar. If the user tap on a button, I need to open the second view with a navigation bar and a table view. The user can also add new items to the table view. If the user do so, the application will show the third view where the user can add fields (this view has also a navigation bar).
It may seem simple, but for me it is not. I don't know how to use the UINavigationController and have not found yet a similar example for what I do (paragraph translated by google).
UPDATE
I don't know how where to put UINavigationController.
How can I do that? Can I use a UIViewController to call a UINavigationController?
Thank you.
take a look at the Recipes example (it also uses core data which may confuse things a little) http://developer.apple.com/iphone/library/samplecode/iPhoneCoreDataRecipes/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008913
There is also a simpler starting point here http://developer.apple.com/iphone/library/samplecode/TableViewSuite/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007318 but the Recipe example covers just about everything you need.
EDIT:added the following
For the very simplest example use XCode to build a new application - a navigation based application (sorry, I'm in front of a PC today so that is from memory). That will give you a blank application with the navigation controller created. You then use the navigation controller to push and pop your view controllers
ViewController Programming Guide

Navigate to a SplitViewController

I've been playing around with the iPad SDK looking for ways to improve my current iPhone app. I've got a couple place where I think the new "SplitView" would look pretty good. My question is if it's possible to navigate to a "SplitView" with my current navigation based application? Mainly I'm not sure how to push that SplitViewController onto my current stack of views. Any thoughts?
It should always be the root controller according to Apple.
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.
You can use a UISplitViewController in a UITabBarController without any problems. I have not attempted to push a UISplitViewController into an UINavigationController however.
(At least) with iOS 8 (which runs on any ipad except the first one) it's possible to use a "present modally"-segue to display a splitviewcontroller.
Drawback is that an existing navigation bar isn't displayed.
Check out the Multiple Detail Views sample app on Apple's Documentation, this could give you a good idea on how to deal with navigation structure and how to display views on the "splitViewController".