您的位置:首页 > 大数据 > 人工智能

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

2016-02-18 13:33 537 查看
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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: