The header displayed in the UINavigationBar comes from the currently active UIViewController.
For example, let's say we need a UINavigationController with a root view controller, MyCustomViewController.
In our application delegate:
- (void)applicationDidFinishLaunching:(UIApplication *)application { UIViewController *myCustomViewController = [[MyCustomViewController alloc] init]; navController = [[UINavigationController alloc] initWithRootViewController:myCustomViewController]; [window addSubview:navController.view]; [window makeKeyAndVisible]; }
In MyCustomViewController.m:
- (void)viewDidLoad { self.title = @"Hello World!"; }
richleland
source share