Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ethana

macrumors 6502a
Original poster
Jul 17, 2008
836
0
Seattle, WA
OK I hate to admit this, but I'm having trouble with a basic concept: Switching views. Someone PLEASE HELP!

I've started off with the basic project using the "View-based application" template that Xcode provides. I've called the project "testing". When it opens in Xcode, I have a testingViewController.xib and a MainWindow.xib.

I've created a button in Interface Builder on the View within testingViewController.xib. I've connected the button to a method called (IBAction)switchViews which I created. The method is currently empty.

I've also created a new View (called Second.xib) and ViewController (called SecondViewController .h and .m). In Interface Builder I attached the xib to the class.

Ok so now for my question. When I press the button on my testingViewController.xib, how do I make it show my Second.xib???

Thanks!

Ethan
 

neil.b

macrumors member
Nov 20, 2008
65
0
Look at, study and understand the Xcode template "Utility Application".

:)
 

liptonlover

macrumors 6502a
Mar 13, 2008
989
0
I don't do it the way most do, but here's how I did it.

I start a project, just a basic iphone app with a window. I put 2 views in the window, one directly on top of the other. To switch views, just use an external custom class that's connected to the two views, the window, and the buttons for switching. When the user presses the button, the other view is brought to the top using the method in uiwindow or uiview, can't remember which.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.