How do I make it push another view?

Discussion in 'iPhone/iPad Programming' started by nomar383, Feb 19, 2009.

  1. macrumors 65816

    nomar383

    Joined:
    Jan 29, 2008
    Location:
    Rexburg, ID
    #1
    I have a root view controller which (right now) pushes to one other view controller when a cell is selected. That's fine for my first 4 cells in the root view controller. But, for cell 5 I want it to push to a second view controller to display the "credits" for my app. How should I do this?
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2
    Are you implementing UITableViewDelegate? If so you can just add a check in tableView:didSelectRowAtIndexPath: to see if the selected row was == 5.
     
  3. thread starter macrumors 65816

    nomar383

    Joined:
    Jan 29, 2008
    Location:
    Rexburg, ID
    #3
    No worries, I figured it out. Just an if statement in my appdelegate to determine whether the index path was != 4 or == 4.

    Another question though, say I have a table view for my root view controller, then I push to another table view. If I wanted to push to a third table view from there, would my appdelegate by doing the lifting, or would my latest view controller? I haven't been able to find an example online of someone with three table views, one after the other...
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Check out the sample app DrillDownSave.
     
  5. thread starter macrumors 65816

    nomar383

    Joined:
    Jan 29, 2008
    Location:
    Rexburg, ID
    #5
    Thank you! I knew I had seen that somewhere before! And it makes way more sense than what I was doing :) lol
     

Share This Page