ios - NavigationController is showing another view controller instead of pushing viewcontroller -


i have main viewcontroller named viewcontroller(if run project runs firstly). if push detailviewcontroller, showing viewcontroller view.

here part of code:

appdelegate.m

viewcontroller *viewcontroller = [[viewcontroller alloc] initwithnibname:nil bundle:nil];     self.navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:viewcontroller];      self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]];     self.window.rootviewcontroller = self.navigationcontroller;     [self.window makekeyandvisible]; 

viewcontroller.m

detailviewcontroller *detailvc = [[detailviewcontroller alloc] initwithnibname:nil bundle:null];     [self.navigationcontroller pushviewcontroller:detailvc animated:yes]; 

check following code

detailviewcontroller *detailvc = [[detailviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:detailvc animated:yes]; 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -