Make iOS project without storyboard

本文详细介绍了如何在Xcode 5中启动一个没有Storyboard文件的项目,包括删除与Storyboard关联的文件、手动添加XIB文件、修改AppDelegate文件以正确加载视图控制器等内容。

ref link:http://stackoverflow.com/questions/18932473/xcode-5-open-a-project-without-story-board


1) Remove Main.storyboard file and related view controller files linked to storyboard from your project.

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) Remove 'Main storyboard file base name' and 'Main storyboard file base name ipad' propertyfrom plist.

4) Change appdelegate didFinishLaunchingWithOptions file and add :

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值