Graphics Programs Reference
In-Depth Information
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
ItemsViewController *itemsViewController = [[ItemsViewController alloc] init];
// Create an instance of a UINavigationController
// its stack contains only itemsViewController
UINavigationController *navController = [[UINavigationController alloc]
initWithRootViewController:itemsViewController];
[[self window] setRootViewController:itemsViewController];
// Place navigation controller's view in the window hierarchy
[[self window] setRootViewController:navController];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
Build and run the application.
Homepwner
will look the same as it did before - except
ItemsViewController
's
view
was resized to fit the screen with a navigation bar.
UINavigationController
did this for you.
Figure 11.5 Homepwner with an empty navigation bar