subview from main view

Discussion in 'iOS Programming' started by Poy77, Oct 4, 2010.

  1. Poy77 macrumors newbie

    Joined:
    Sep 5, 2010
    #1
    I know that I can use UITableViewController to create main view with multiple subviews. I can't use it in my case. I have many button in the main view (UIView) and when someone would press a button, then it opens a subview (UIView).

    I have tried to use similar solution than in table view but I got compilation error:
    [[self navigationController] pushViewController:targetViewController animated:YES];
    I have to also implement a back button, which would be very easy to implement in table view.

    Shall I use initWithNibName each time the button is pressed? Could it work?
    I looked many Apple's examples, but I didn't find similar solution.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    I suspect you mean a main view with multiple detail / secondary views. Subviews are normally considered to be views that are contained within a view (i.e. not on a separate screen). And it's not the UITableViewController that is taking care of this. It's a UINavigationController.

    Well, that's the code. What's the error?
     

Share This Page