Could not find a storyboard named 'Main' in bundle NSBundle

来源:互联网 发布:qsv格式转换器mac版 编辑:程序博客网 时间:2024/05/21 06:34

1、删掉工程中main.storyboard 后要删除plist文件中对应的键值,否则会报如下错误: Could not find a storyboard named ‘Main’ in bundle NSBundle

这里写图片描述

2、删除main.storyboard后,需要在AppDelegate.m中初始化一个window进行使用,否则应用程序没有window可用。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    // Override point for customization after application launch.    //设置主界面    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];    MainViewController *mainVC = [[MainViewController alloc] init];    self.window.rootViewController = mainVC;    self.window.backgroundColor = [UIColor yellowColor];    [self.window makeKeyAndVisible];    return YES;}
0 0