I'm having trouble with a basic concept - Switching views

Discussion in 'iOS Programming' started by ethana, Dec 30, 2008.

  1. ethana macrumors 6502a

    Jul 17, 2008
    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???


  2. neil.b macrumors member


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

  3. liptonlover macrumors 6502a

    Mar 13, 2008
    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.

Share This Page