didSelectRowAtIndexPath with no navigation controller

Discussion in 'iOS Programming' started by fergusjk, Sep 19, 2010.

  1. fergusjk macrumors member

    Joined:
    Aug 23, 2010
    Location:
    Ayrshire Coast, Scotland
    #1
    I have a tabbar app that is using a UITableView in one of the tabs. When the user selects one of the rows I want a new view to show up.

    I am not currently using a Navigation bar as there is already plenty of competition for screen real estate in that view.

    I have the following code
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"IN HERE!!!!");
    NSLog(@"indexPathSection=%d", indexPath.section);
    NSLog(@"indexPathRow=%d", indexPath.row);

    ViewWithFurtherDetail *detailViewController = [[ViewWithFurtherDetail alloc] initWithNibName:mad:"ViewWithFurtherDetail" bundle:nil];

    [self presentModalViewController:detailViewController animated:YES];
    [detailViewController release];

    }

    This works but it animates up from the bottom rather from the right.

    Two questions.
    1. How do I get this to animate from the right?
    2. How do I 'get back' to the UITableView view once the new view is established? I'm probably going to have a small button with title 'back' which the user can press but what is the actual code required to return to the previous view?
     
  2. fergusjk thread starter macrumors member

    Joined:
    Aug 23, 2010
    Location:
    Ayrshire Coast, Scotland
    #2
    I ultimately went with the Navigation controller on top of the tab bar, therefore I have a navigation view as one of my tabs.

    It was relatively easy to implement actually. If anyone is interested then type in "tabbar navigation" to youtube and there are a few good tutorials on the matter. :D
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    If you feel your screen real estate is precious, you might want to consider hiding the navigation bar until it's needed.
     
  4. fergusjk thread starter macrumors member

    Joined:
    Aug 23, 2010
    Location:
    Ayrshire Coast, Scotland
    #4
    Good point Dejo, but now that I see it there it looks rather neat :D
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Hey, no problem. I'm certainly not gonna talk you out of it. :)
     

Share This Page