I have a navigation based templete in which we get default file appdelegate.h,.m file and rootviewcontroller.h and.m file. Now i have required in project that rootviewcontroller will show only first time when application install in device. And in rootviewcontroller i have button o click event of that i add new view as subview. And on New view i have a button which further proceed a new view. To proceed new view i have use [self.navigationcontroller pushviewcontroller:new_view1 animated:YES] but this is not working. Means not pushing view. How i fix it?
In appdelegate file i use this code for didfinish launch:-
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
and on button click of rootviewcontroller i use this code:-
- (void)parser{
main_view_obj=[[Home_Screen_viewController alloc] initWithNibName:@"Home_Screen_viewController" bundle:nil];
[self.view addSubview:main_view_obj.view];
}
end on button clikc of mainview i use this code:-
-(IBAction)accounts{
[appDelegate startProgressBar:@"while loading data..."];
account_view =[[Account_login_viewController alloc] initWithNibName:@"Account_login_viewController" bundle:Nil];
[self.navigationController pushViewController:account_view animated:YES ];
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Home" style:UIBarButtonItemStyleBordered target:nil action:nil] autorelease];
[appDelegate endProgressBar];
}
Now problem is that [self.navigationController pushViewController:account_view animated:YES ] not working. How fix it?
Try this, it will work