7

I am working on iOS 5. I am not able to find the navigation based application template formerly found in Xcode.

So what can I use instead?

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
Purva
  • 1,291
  • 2
  • 15
  • 30
  • Similar to question: http://stackoverflow.com/questions/8196123/replacement-for-navigation-based-application-template-in-xcode-4-2?lq=1 – Basil Bourque Aug 15 '13 at 04:16

4 Answers4

13

If you want to start from scratch, start with a Single View Based project, then go to the storyboard and select the viewController, go to Editor > Embed in > Navigation Controller.

RDM
  • 4,986
  • 4
  • 34
  • 43
8

You need to use Master-Detail Application template. Choose Device Family from dropdown list as iPhone. After creating a project your appDelegate will contain UINavigationController instance.

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;

@end

and

@implementation AppDelegate

@synthesize window = _window;
@synthesize navigationController = _navigationController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.

    MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease];
    self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}
beryllium
  • 29,669
  • 15
  • 106
  • 125
  • Nice! I read the best way to do it was via a single view based project, but this seems to be more like the old navigation based template. Still think it's strange apple made it so obscure... it was my most used template :P – RDM Nov 23 '11 at 09:47
3

Use storyboard and drag a view controller into it. Then go Editor>Embed In>Navigation Controller.

dasdom
  • 13,975
  • 2
  • 47
  • 58
1

Start with the Empty Application project. Add a UINavigationController.

This article, Creating a Navigation based iOS 5 iPhone Application using TableViews, will guide you. And this tutorial, Navigation Controllers and View Controller Hierarchies.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154