2013-05-08 29 views
0

我通過改變主故事板沒有禁用故事板。而且我已經重寫了一切,所以我不需要故事板並且它可以正常工作。但是在控制檯日誌中,應用程序窗口在應用程序啓動結束時應該有一個根視圖控制器。 我可以忽略這條消息嗎?他們會在提交後批准我的應用程序? 的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; 
} 
+0

重置模擬器和檢查一次。 – LittleIDev 2013-05-08 11:44:27

+0

@Jyotishree不,消息仍然顯示。 – 2013-05-09 02:33:12

回答

2

我想你的代碼,該問題源於你重新實例應用程序窗口,你不需要做這樣的事實。如果你只是刪除第一行代碼self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];你的應用程序應該無論如何工作,警告應該消失。

+0

但我得到了一個黑色的屏幕。 – 2013-05-09 02:31:18

+0

你說得對,我仍然有一個主要的筆尖文件,這就是爲什麼我沒有需要的alloc-INIT我self.window我現在確實想你的設置和self.window確實需要初始化,你的代碼,但是,工作正常並沒有給我任何警告(沒有故事板,沒有xib文件,全部通過代碼完成)! – micantox 2013-05-09 08:54:30

+0

您是否刪除了項目plist文件中的「主要故事板文件基本名稱」屬性? – micantox 2013-05-09 09:01:47

相關問題