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;
XIB文件链接controller文件&&加载rootviewcontroller
时间: 2024-10-09 15:11:02