There's something fundamental that I'm not understanding about presenting views that get their interface from a XIB file.
My app's root view controller is a UITabBarController. One of the tab bar options presents a UINavigationController-controlled view. One the navigation bar of that view, I have a plus (+) button for adding a new item. I want to present the AddItem view as a modal view, and it should take its interface from the AddItemView.xib file. That XIB file has in it a Navigation Controller.
However, the navigation bar doesn't appear. Here's the function that gets called when clicking on that plus button:
- (void)showNewView:(UIViewController *)viewController
{
AddItemViewController *vc = [[AddItemViewController alloc] initWithNibName:@"AddItemViewController" bundle:nil];
//viewController is the UIViewController on which the plus button was tapped
[viewController.navigationController presentModalViewController:vc animated:NO];
}
All I get is a white screen. Do I need to do something in viewDidLoad for AddItemViewController? Do I need to connect something to the UINavigationController instance in the XIB?
All this seems to just work with the tab bar, which is in the MainWindow.xib file. The UITabBarController there has a UINavigationController under it, which in turn has a subclass of UITableViewController under it, and that in turn contains the UITableView that is the initial content you see on the screen when tapping on the corresponding option in the tab bar. So I'm not sure why just sticking those things in IB doesn't cause the same to happen.
As I said in the beginning, I'm sure this problem stems from a fundamental misunderstanding about the relationship between XIB files, their view controllers, and the view controllers that call upon them. So while I do want to get this particular issue solved, I'd love an answer that can address this broader misunderstanding.