XIB文件链接controller文件&&加载rootviewcontroller

1.定义好的xib文件rootView.xib,选中files·owners  在class中选择对应的viewController

2.如何在window中指定rootViewController

------在appdelegate.h中声明属性

 @property (strong,nonatomic)rootViewController* rvc;

------在appdelegate.m中的didFinishLauchingWithOptions:方法中加载rvc

self.rvc = [[rootViewController alloc]initWithNibName:@"rootView" bundle:nil]; //rootView是rootView.xib文件的名字

self.window.rootViewController = rvc;

//显示window

[self.window makeKeyAndVisible]; 
return YES;

posted @ 2014-08-07 10:02  迷茫的程序小生  阅读(230)  评论(0编辑  收藏  举报