0

I disabled storyboard by change the Main Storyboard to nothing. And I have rewrite everything so I don't need a storyboard and it working correctly. But in the console log, Application windows are expected to have a root view controller at the end of application launch occurred. Could I just ignore the message and They will approve my app after submitted? The didFinishLaunchingWithOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];  
    self.tabBarController = [[AKTabBarController alloc] initWithTabBarHeight:65];
    SubscribeViewController *sub = [[SubscribeViewController alloc] initWithNibName:nil bundle:nil];
    UINavigationController *navControlelr = [[UINavigationController alloc] initWithRootViewController:sub];
    NewHomeViewController *home = [[NewHomeViewController alloc] initWithNibName:nil bundle:nil];
    UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:home];

    ReceivedPushViewController *receivedPush = [[ReceivedPushViewController alloc] initWithNibName:nil bundle:nil];

    MoreViewController *more = [[MoreViewController alloc] initWithNibName:nil bundle:nil];

    NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:@[homeNav, navControlelr, receivedPush, more]];

    [self.tabBarController setViewControllers:viewControllers];
    [self.window setRootViewController:self.tabBarController];
    [self.window makeKeyAndVisible];

    return YES;
}
yong ho
  • 3,892
  • 9
  • 40
  • 81

1 Answers1

2

I tried your code, the problem arises from the fact that you reinstantiate the application window, which you don't need to do. If you just remove that first line of code self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; your application should work anyway and the warning should go away.

micantox
  • 5,446
  • 2
  • 23
  • 27
  • You're right, I still had a main nib file and that's why i didn't need to alloc-init my self.window I now actually tried your setting and self.window does need initialization, your code, however, works fine and doesn't give me any warning (no storyboard, no xib files, all done through code)! – micantox May 09 '13 at 08:54
  • Did you delete the property "Main storyboard file base name" in the project plist file? – micantox May 09 '13 at 09:01
  • Could you create a project using storyboard, and then disable the storyboard and try the code again? Because I am wondering that it's because of the storyboard is missing, but the code is working, and the system couldn't get around with that. – yong ho May 09 '13 at 09:03
  • I tried! No matter what i do, i never get that warning! I tried: -Deleting the storyboard file without changing the project settings, leaving the storyboard file and editing the project properties so that it wouldn't use it, deleting the file and editing the project storyboard property and even leaving both the storyboard file and the project property! – micantox May 09 '13 at 09:08
  • I see. Could I just ignore the message? – yong ho May 10 '13 at 02:41