ios - Could not find a storyboard named 'main' in bundle NSBundle

查看:238
本文介绍了ios - Could not find a storyboard named 'main' in bundle NSBundle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //创建窗口
    self.window =[[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    //加载main.storyboard 创建控制器
    UIStoryboard * stotyboard=[UIStoryboard storyboardWithName:@"main" bundle:nil];
    //1.加载箭头指向的控制器
    UIViewController *vc = [stotyboard instantiateInitialViewController];
    
    
    //设置跟控制器
    self.window.rootViewController=vc;
    
    //显示窗口
    [self.window makeKeyAndVisible];
    return YES;
}

解决方案

确定是main?不是Main?

这篇关于ios - Could not find a storyboard named 'main' in bundle NSBundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆