Roskvist
Roskvist

Reputation: 1040

iOS:Switching between views using UINavigationBarController

First of all, I am using XCode 4.2 and I am not using storyboards. I need to make an application with 2 views.

First view will contain a button and a navigation bar, the button's IBAction should only go to the second view, and from the secondview you should be able to go back to the first view via the Navigationbar.

My problem is the navigation controller / navigation bar, how do I set that up ?

I know that it would be smart using the singleView app and then add a navigation controller, the problem is that I dont know how to set it up in the code.

I have searched for similar problems on the internet, and I keep getting into posts where they use another SDK or using an older xcode etc.

What I do know is how to make the button, actions and delegation.

Anyone out there who is sitting with the one and only tutorial I am missing or can tell me how to do it ?

Thank you

Upvotes: 0

Views: 633

Answers (3)

pinkeerach
pinkeerach

Reputation: 408

if you really want to learn how to implement it from scratch (and not depend on the master-detail template), i highly recommend the following resources:

also found this tutorial in a quick google search, but haven't fully vetted it in xcode 4.2 (there will likely be small differences in how you have to go through the steps).

Upvotes: 1

Peter Sarnowski
Peter Sarnowski

Reputation: 11970

Use the Master-Detail Application template. Ignore the stuff for tables, it has navigation stack implemented in it. By deleting the tables, you should be pretty much left with what you are after.

Upvotes: 1

bneely
bneely

Reputation: 9093

You should go to http://developer.apple.com/, search for UINavigationController, click on UINavigationController Class Reference, then look at one of the linked sample code projects there.

Upvotes: 1

Related Questions