1

I'm a fairly new programmer and I had been taught how to switch between two views using a toolbar button as the root controller. I am now making an app for fun that switches between 5 views (but for the look of it I dont want to use a tab bar). Instead of using the tab bar i would like to have 5 buttons on each view that switch between the other views and itself. I am at a loss of how to even begin. I would greatly appreciate if anyone could offer any kind of help or even a link for a good beginner tutorial on the matter... Thank you.

Charles
  • 50,943
  • 13
  • 104
  • 142
nfoggia
  • 513
  • 1
  • 8
  • 28

1 Answers1

1

Start an Utility Template project in XCode.

RUN IT...USE IT..Then go through the code to learn how it functions

This way you will become better : Not by a particular answer here .

Shubhank
  • 21,721
  • 8
  • 65
  • 83
  • I have been looking at it for a couple hours and one thing i dont get. Do you have to create a root controller for each button? like to switch from the home screen to screen 2 do i need a root controller for that and also to switch from home screen to screen 3? – nfoggia Jan 20 '12 at 07:06
  • no you don't have to create a root view controller for each button..a root view controller is for a window..so the window loads the main View Controller as its root view controller and MainviewController show info button method loads Flipside view controller as a modal view which you have to do(for each button). – Shubhank Jan 20 '12 at 07:17
  • I have created a method for each button to switch to the correct screen once pressed. But i am still unsure on how to code it, i just have the empty shell: -(IBAction)switchToView1:(id)sender{ } so what would i do to have them switch? it is so confusing, every tutorial i read through has a million different things and idk if they are for just their situation or any situation – nfoggia Jan 20 '12 at 07:24
  • did you go through the utility template project..check the show info button method in MainViewController.m that is the code to initialize..from what you are asking..i believe you have very little knowledge of iOS sdk..get yourself a good book..you will get strong foundation in lesser time using that rather that spending time here and there learning tutorials(which if you can't keep up..can lower your motivation in this field..I don't want that :D.. – Shubhank Jan 20 '12 at 07:32
  • i managed to figure out how to get the view to switch. Thank you for your help. I have one last question. Is it necessary to remove the last view with the removeFromSuperview method? – nfoggia Jan 23 '12 at 06:32
  • can you give more info with code..which view are you removing and where? – Shubhank Jan 23 '12 at 07:00