我希望在标签栏应用程序中启动时打开一个特定的选项卡.我得到警告警告:尝试出现< settingsViewController:0x16e49870> on< UITabBarController:0x16d25440>其视图不在窗口层次结构中!
self.tabBarController.selectedindex = 1;
我试过DidFinishLaunching
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; numpadviewcontroller = [[tabBarController viewControllers] objectAtIndex:0]; settingsviewcontroller = [[tabBarController viewControllers] objectAtIndex:1]; [tabBarController setSelectedindex:1];
但得到同样的警告.我正在使用故事板