Sorry for the long story -
I have some questions about the proper use of the navigation controller hierarchy.
Everyone UIViewControllerhas the propertyself.navigationController
But not every view controller is represented with a navigation controller, so this property may be null.
Moreover -
Some view controllers expect to be able to:
[self.navigationController presentViewController:nextViewController]
but if it itself is not contained in the hierarchy of the navigation controller, this expression will do nothing.
So, the trainee, the view controller, can check whether it was built into the navigation controller:
if (self.navigationController == nil)
{
UINavigationController *nav = [UINavigationController alloc] initWithRootViewController:nextViewController];
[self presentViewController:nav];
}
- , , . :
[self presentViewController:nextViewController]
?
- , -
, UINavigationController -
, , .. .
- self.navigationController == nil - "" , ?
:
iOS , , UITabBarController, UIViewNavigationController - - "" "" .
( ), UITabBar .
container
(, " " ) - , .
- .
- , UINavigationController, (-nil), - ..
"" ( ) -
navigationController ?