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

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

Could not find a storyboard named 'Main' in bundle NSBundle_第1张图片

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;
}

你可能感兴趣的:(application,bug)