iPad SplitView with navigation stack for multiple view controllers - objective-c

Hey,
my starting point was this
MultipleDetailViews sample code found on xcode.
I am trying to create a separate navigation stack for the First- and SecondDetailViewController in order to push new view controllers.
A great help was this tutorial but I still couldn't manage to include the navigation stacks.
I have been stuck on this problem for a while and wonder if there exists a simple solution...
Thanks in advance for any suggestions.

In the sample code, try to open the MainWindow.xib (en) and remove the 'FirstDetailViewController', replace it with a NavigationController, add the rootViewController for this new detail NavigationController and you are good to go.
I guess that you know what to do next. Hope it helps.

looking at this believe i had exactly the same problem and never found a way around it, until a couple of days when i was watching an unrelated lecture off of iTunes U, anyway in the new view controller that you load, have you implemented the UISplitViewControllerDelegate, (if this doesn't work have you tried moving the UISplitViewControllerDelegate to the master controller)?

Related

How to add multiple views to a split-view controller?

I am developing an app for the iPad, using split-view and storyboards. I did this once before quite a while ago but didn't write down how to do it. I've googled and SO'd all morning and found nothing specifically targeting my question.
I know there is a way to add multiple detail views by dragging objects to the storyboard canvas, and somehow (that's the question) setting the new object as either master or detail...
Anybody know how to do that?
I give up... decided to go to with a tab bar controller; much simpler. And the fact that it got voted down indicates to me nobody knows the answer.
Thanks anyway to all who looked at it.

IOS menu/design

Relevant Data:
I'm making a simple game, using OpenglES. The game itself is done, however I would like to have a main menu as well as some other screens designed in IB. So far I have a death/score screen that is displayed with a simple modelviewcontroller.
I haven't done a ton with GUI building or much programming on the platform outside of C code (posix sockets) and some examples from some books. So I'm not sure how I would go about having lots of views- usually I just use a model view, and it's gotten me along just fine so far. However I don't think that would be the best route here.
Situation:
I have a view controller that shows my main menu- the main menu branches off to the main game, a settings screen, and a high score screen. The main game is made in opengl, and I haven't made the settings view yet, but it likely will be as well. How should I switch between the views? Presenting the main view from the app delegate is as simple as setting the root view controller = newly created view controller, should I do the same thing here? If I do that can I remove the resources from the menu view controller?
Sorry if this is an extremely simple question, I just don't quite get the process.
I'm not entirely sure what you want to do, but an easy way to show a new view controller is:
SecondViewController *aSecondViewController = [[SecondViewController alloc]
initWithNibName:#"SecondView" bundle:nil];
[self presentModalViewController:aSecondViewController animated:YES];
I hope that helps.
How should I switch between the views?
In the vast majority of cases, you should be using a UINavigationController. Your initial controller would be the main menu. When you want to go into a particular section of your application, you push a new view controller onto the stack. When you want to come back out, you pop it off the stack.
Besides navigation and presenting modally that others have mentioned, another option is to swap out views. May or may not fit your app's flow but wanted to point out another option for you to consider
Best practice for switching iPhone views?
If you are already limiting the game to iOS 5 for some other reason you should look into UIStoryboard. If you don't currently require iOS5 the "simplest" way is to use table views, but that isn't a very "gamey" UI.

UINavigationController inside UITabBarController - Two Navigation Bars?

Here are the steps I've followed - pretty much this: http://www.youtube.com/watch?v=cFNtD098Bbk&feature=player_embedded
Create new Tab Bar Application
Looking at MainWindow.xib I drag a UIViewController in
Drag one of the tabs View Controllers onto the UIViewController
Set up buttons and actions top push the new view
Note I have no idea how he did the last step in the video, dragging one tab object onto another won't work for me
The navigation works fine, the new view gets pushed and all that jazz. But when I go to the tab that has the navigation controller it has two navigationBar's.
I can't find where to get rid of this for the life of me. It must be something really simple but I've been searching for way too long.
None of the many tutorials I've found have this problem, not does the project files of those tutorials even though my project looks pretty much the same as theirs in IB.
Does anyone know how I can get rid of the useless navigation bar?
I'm using Xcode version 4.0.1
Not sure how I missed it but the answer was stupidly simple.
Just needed to delete the UIToolbar from the nib file, can't believe I didn't find that earlier.

A simle view with a button that calls another view with a tab bar controller

It is quiet embarrassing but I just don't get it.
How should I browse prom viewA to viewB to viewC
if I have a main view "viewMain"... how can I make it call a view with a tab bar controller for the views viewTabA, viewTabB and viewTabC. (All views should give me the option to go back to the main view "viewMain")
It just so frustrating that I can't find it on Google: I can't believe that people who are creating a simple game (full screen), and some info "pages", have not solved this before.
I have tried everything...got close but...Please any help, lead, tip would be highly appreciated :_(
You mean your UITabBarController has three pages A, B, C and you want to change that programmatically?
That's easy. Just do
yourTabBarController.selectedIIndex = ... or
yourTabBarController.selectedViewController = ...
If there you don't find a solution for a problem you think many people face, then almost always the way you are trying to solve it is wrong. :-)
There is a nice implementation very similar for what I've been looking for in the Stanford University iphone course
http://www.youtube.com/watch?v=4CBMusxvivE&feature=related

IPhone Development - Switching Views

So I have programatically created a tabbarcontroller that uses navigation controllers(based on Jeff Fithian's example). Now I need to push an additional page onto the navbarcontroller (ie I have clicked on an item on the list) but I can't quite figured out how to get a reference to the navigation controller of the current view from it's view controller.
I went with the programmatic approach, because it was the only way to start out the project that worked, but now I am getting really bogged down.
Any ideas?
I am sure there is a tutorial somewhere that addresses this, but after four days of looking (I am in the middle of the MidAtlantic "snow" emergency) I have found nothing...
You can find the navigation controller from the view controller with the .navigationController property.
[my_view_ctrler.navigationController pushViewController:other_view_ctrler animated:YES];