1. Step: Create a new UIViewController:
- Xcode -> New File... -> Cocoa Touch Class -> UIViewController
- Name: MyViewController
2。 Drag和将图书馆的“海军主计长”改为MyViewController。
3.Step: I m sure, I have to do something to connect the Navigation Controller correctly, isn t it?
4.Step: 着手设立新的观点主计长,作为示范方言:
MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
NSLog(@"navContr: %@", myViewController.navigationController);
[self.navigationController presentModalViewController: myViewController animated:YES];
成果:“无”
5.Step: 你可以看到新的模式观点(MyViewController),但没有航海主计长,也没有UINavigation Bar。
非常感谢你们的帮助!
<>>>>>
6.Step: I set a new UIViewController (ViewNavi2) as "Root View Controller":
7.Step: 我在MyViewController and configure the xib: Navigationller ->Links -> Referencing Outlets
但是,我的航海主计长仍然没有:
MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
NSLog(@"navContr: %@", myViewController.navigationController);
// -> "navContr: nil"