Push View Controller?

Discussion in 'iOS Development' started by Just_For_Now, May 12, 2009.

  1. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    Is there a way that i can push a view controller without the current view having a navigation bar?
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Yes it's very simple

    Code:
    [self pushViewController:yourOtherViewController];
  3. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    oh wow I did not know. Thanks man.
    How about all those other animated views like the view coming up from the bottom?
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Well pushing a view controller is what you said, it pushes the view from the bottom. The other view "switches" are using CATransitions and UIViewAnimations, look in the dev tutorial section I think skylar made a tutorial that included some.
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    WRONG WRONG WRONG!

    UIViewController has no such method... It does have the ability to push a modal view controller from the bottom as you suggested, via this method:

    Code:
    [someController presentModalViewController:anotherController animated:YES];
  6. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    ughhh yeah my bad.....

    Please Register or Log in to view images

    I didn’t look at my projects.
  7. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    oh so chicken was wrong?
    ok yeah that explains alot. thanks johnnyboi
  8. Unregistered

    Unregistered Guest

    This doesn't work on iPad

    - (IBAction)addRow

    Please Register or Log in to view images

    id)sender {
    NSLog(@"Add a Row!");
    UIViewController *myViewController = [[UIViewController alloc] init];
    myViewController.title = @"My First View";
    myViewController.view.backgroundColor = [UIColor redColor];
    [[self navigationController] pushViewController:myViewController animated:YES];
    }

    I have a button that calls the above. I would have thought I'd see a red background view replace the present screen, but no joy!

    When I do this on the iPad nothing happens except the log statement in the console!

    What is wrong?
  9. NolesFans

    NolesFans New Member

    Joined:
    Sep 23, 2008
    Messages:
    404
    Likes Received:
    0
    Device:
    iPod touch
    Did you see Add a Row! in the debugger console?
  10. Unregistered

    Unregistered Guest

    Yes

    only that

Share This Page