Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

pushViewController versus presentModalViewController

Oliver DrobnikOliver Drobnik Vienna, AustriaPosts: 538New Users, Registered Users @ @ @
edited September 2008 in iPhone SDK Development

can anyone explain what the difference is between PushViewController and presentModalViewController?

iside a navigation view controller:

AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];

[self pushViewController:anotherViewController animated:YES];


[self presentModalViewController:anotherViewController animated:YES];

gives a different result. With the first I see the Navigation bar updated according to what I set in the XIB. With the second the window slides in from below, but is missing a navigation bar.

my anotherView XIB consists of the following:

File's Owner
First Responder
Navigation Bar
Navigation Item
Bar Button

I am looking at the SQL Books sample and there the same XIB is used. For Editing the view slides in from the right. For adding it slides in from below. I don't see why the modal version would not show the navigation bar ...
Post edited by Oliver Drobnik on
Buy my book "Barcodes with iOS 7":

Get 50% until March 9th with promo code "mldrobnik"


Sign In or Register to comment.