Xcode 5,禁用Storyboard [英] Xcode 5, disabling Storyboards

查看:100
本文介绍了Xcode 5,禁用Storyboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

Xcode 5不再有复选框表示你不想使用故事板,

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

任何人都可以帮忙吗?这真的很烦人......

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

推荐答案

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

1 /创建一个空项目

1/ Create an empty project

2 /为控制器添加带xib的新文件,如果不是在构建阶段的编译源中添加,然后手动添加。

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

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

4) Change appdelegate didFinishLaunchingWithOptions file and add :

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

[self.window makeKeyAndVisible];

就像:

  - (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;
  }

删除故事板的步骤

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

1) Remove Main.storyboard file from your project.

2)为控制器添加带xib的新文件,如果是在构建阶段未在编译源中添加,然后手动添加。

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

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

3) Remove Main storyboard file base name from plist.

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

4) Change appdelegate didFinishLaunchingWithOptions file and add :

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

[self.window makeKeyAndVisible];

就像:

  - (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;
}

看看这里

这篇关于Xcode 5,禁用Storyboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆