Cannot find Xcode 4 new project template for navig

2020-07-12 05:09发布

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?

4条回答
Fickle 薄情
2楼-- · 2020-07-12 05:41

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

查看更多
Viruses.
3楼-- · 2020-07-12 05:45

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;
}
查看更多
够拽才男人
4楼-- · 2020-07-12 05:53

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.

查看更多
Bombasti
5楼-- · 2020-07-12 06:08

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.

查看更多
登录 后发表回答