Xcode 5,禁用故事板

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19052696/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:56:39  来源:igfitidea点击:

Xcode 5, disabling Storyboards

iosxcodeuikitxcode5

提问by Woodstock

I don't want to use story boards, i'd much rather use NIB's for UI when necessary, and I particularly don't want to use them for the default templates.

我不想使用故事板,我更愿意在必要时将 NIB 用于 UI,而且我特别不想将它们用于默认模板。

Xcode 5 no longer has the check box to say you don't want to use Storyboards,

Xcode 5 不再有复选框表示您不想使用 Storyboards,

can anyone help? It's really annoying...

有人可以帮忙吗?真的很烦...

回答by Jordan Montel

STEPS FOR REMOVE STORY BOARD - XCode 5 (EDIT)

移除故事板的步骤 - XCode 5(编辑)

1/ Create an empty project

1/ 创建一个空项目

2/ Add new files with xib for your controller , if it is not added in compiled sources in build phases then add there manually.

2/ 为您的控制器添加带有 xib 的新文件,如果它没有在构建阶段添加到编译源中,则手动添加。

4) Change appdelegate didFinishLaunchingWithOptions file and add :

4) 更改 appdelegate didFinishLaunchingWithOptions 文件并添加:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;

[self.window makeKeyAndVisible];

just like :

就像 :

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;

     // Override point for customization after application launch.

     TestViewController *test = [[TestViewController alloc]     initWithNibName:@"TestViewController" bundle:nil];
     UINavigationController *nav = [[UINavigationController alloc]  initWithRootViewController:test];
     self.window.rootViewController = nav;

     [self.window makeKeyAndVisible];

     return YES;
  }

STEPS FOR REMOVE STORY BOARD

移除故事板的步骤

1) Remove Main.storyboard file from your project.

1) 从您的项目中删除 Main.storyboard 文件。

2) Add new files with xib for your controller , if it is not added in compiled sources in build phases then add there manually.

2)为您的控制器添加带有 xib 的新文件,如果它没有在构建阶段添加到编译源中,则手动添加。

3) Remove Main storyboard file base name from plist.

3) 从 plist 中删除主故事板文件的基本名称。

4) Change appdelegate didFinishLaunchingWithOptions file and add :

4) 更改 appdelegate didFinishLaunchingWithOptions 文件并添加:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;

[self.window makeKeyAndVisible];

just like :

就像 :

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;

     // Override point for customization after application launch.

     TestViewController *test = [[TestViewController alloc]     initWithNibName:@"TestViewController" bundle:nil];
     UINavigationController *nav = [[UINavigationController alloc]  initWithRootViewController:test];
     self.window.rootViewController = nav;

     [self.window makeKeyAndVisible];

     return YES;
}

Have a look here

看看这里

回答by Johannes Fahrenkrug

Use this script to get all the shiny, happy glorious goodness of the Xcode 4 templates back: https://github.com/jfahrenkrug/Xcode4templates

使用此脚本可以恢复 Xcode 4 模板的所有闪亮、快乐的美好:https: //github.com/jfahrenkrug/Xcode4templates

You will need a copy of the Xcode 4 .app bundle to use this script.

您需要一份 Xcode 4 .app 包的副本才能使用此脚本。