Search code examples
iphoneobjective-cioscore-dataxcode4

MainWindow in Utility Application


I am following the CoreDataBooks Sample Code in a Utility Application, and so far, I have been able to display a tableView without a Navigation bar on top. How can I get the Naviagation bar to display at the top? The TableView is in the FlipsideViewController.

I think that the problem is that the sample code has a MainWindow.xib and a Utility Application does not. How can I create a MainWindow.xib and only have the Navigation Controller on the FlipsideViewController?

Thanks?


Solution

  • Everything that you write must have a UIWindow as that is the superview of everything.

    In order to have a UINavigationController display with your tableView you will have to do this:

    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myFlipSideViewController] ;
    

    Then the same way you are showing your FlipSideViewController show your Navigation Controller instead.