Instance Method

initWithRootViewController:

Initializes and returns a newly created navigation controller.

Declaration

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController;

Parameters

rootViewController

The view controller that resides at the bottom of the navigation stack. This object cannot be an instance of the UITabBarController class.

Return Value

The initialized navigation controller object or nil if there was a problem initializing the object.

Discussion

This is a convenience method for initializing the receiver and pushing a root view controller onto the navigation stack. Every navigation stack must have at least one view controller to act as the root.

See Also

Creating Navigation Controllers

initWithNavigationBarClass:toolbarClass:

Initializes and returns a newly created navigation controller that uses your custom bar subclasses.