2010-12-05 59 views
1

我這樣做:在我的應用程序委託出示一個模式UINavigationController的

navigationController = [[[UINavigationController alloc] initWithRootViewController:homePageController] autorelease]; 
[tabBarController presentModalViewController:navigationController animated:YES]; 

對當前模態的UINavigationController。 但在homePageController中,我怎樣才能在該導航控制器中推送其他視圖?

我應該在homePageController的方法中調用嗎?

MyDelegate *delegate = (MyDelegate *) [[UIApplication sharedApplication] delegate]; 
[delegate.navigationController pushViewController:newView animation:YES]; 

還是應該用另一種方式?

回答

1

您可以通過navigationController屬性訪問任何UIViewController的父導航控制器。所以,在你的HomePageController方法中:

[self.navigationController pushViewController:someViewController animated:YES]; 
+0

非常感謝你的男人。 – 2010-12-05 04:32:26

相關問題