Cannot find a new Xcode 4 project template for an application based on the navigation controller. Any alternative?

I am working on iOS 5. I cannot find the navigation-based application template previously found in Xcode.

So what can I use instead?

+6
source share
4 answers

You need to use the master-detailed application template. Select Device Family from the drop-down list as iPhone . After creating the project, your appDelegate will contain an instance of UINavigationController .

 @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; } 
+8
source

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

+12
source

Use the storyboard and drag the view controller into it. Then go to Editor> Paste in> Navigation Controller.

+3
source

Start with the Empty Application project. Add a UINavigationController.

This article, Creating iPhone from iPhone iOS 5 with TableViews , will help you. And this tutorial, Navigation Controllers and View Manager Hierarchies .

+1
source

Source: https://habr.com/ru/post/902181/


All Articles