What is the correct way to proceed with this bool?

后端 未结 2 526
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 07:57

I have this bool in my AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
             


        
相关标签:
2条回答
  • 2020-12-12 08:41

    Use this in your AppDelegate.m

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
    
    
    
        HomeController *viewController = // initialise it 
    
        self.window.rootViewController = viewController;
        [self.window makeKeyAndVisible];
    
        return YES;
    }
    

    or in the storyBoard just put the pointing arror to the view controller which you want to make as a root view controller.

    0 讨论(0)
  • 2020-12-12 08:43

    The stack trace explains what's wrong:

    • Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle (loaded)' *

    Your storyboard isn't called "MainStoryboard".

    0 讨论(0)
提交回复
热议问题