Please do the following thing:
In AppDelegate.h
@property (nonatomic, retain) UINavigationController *navigationController;
In AppDelegate.m
@implementation AppDelegate
@synthesize navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
}
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
and when you want to push the next viewcontroller , you can write the above code :
-(void)fontButtonPress{
FontViewController *fontViewController = [[FontViewController alloc] initWithNibName:@"FontViewController_iPhone" bundle:nil];
[self.navigationController pushViewController:fontViewController animated:YES];
}
Let Me know if You have any issue.
Thanks