xcode 5 - 打开一个没有故事板的项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18932473/
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
xcode 5 - open a project without story board
提问by Idan Magled
I've recently downloaded the new xCode from the developers' site, and everywhere I look, I can't find a solution as to how to open a project withoutstoryboard.
我最近从开发人员的站点下载了新的 xCode,在我所看到的任何地方,我都找不到有关如何在没有故事板的情况下打开项目的解决方案。
It's important to me because I want to keep my apps working on iOS 4.3.
这对我很重要,因为我想让我的应用程序在 iOS 4.3 上运行。
The way I do it, is by opening the project in the old version and then opening it in the new one. But there must be another way.
我这样做的方法是在旧版本中打开项目,然后在新版本中打开它。但必须有另一种方式。
Thanks!
谢谢!
回答by Bhoopi
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;
}
回答by Chris Chen
Just pick the Empty Application template, my friend
只需选择 Empty Application 模板,我的朋友