最近在 AppDelegate 实例化出现这个问题
我的写法是这样的
TabBarController *tb = [[TabBarControlleralloc] init];
UIBaseNavigationController *baseNavigationController = [UIBaseNavigationControllernew];
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
self.window.rootViewController = baseNavigationController;
[baseNavigationController addChildViewController:tb];
造成了这个问题
正确写法应该是这样
TabBarController *tb = [[TabBarControlleralloc] init];
UIBaseNavigationController *baseNavigationController = [[UIBaseNavigationControlleralloc] initWithRootViewController:tb];
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
self.window.rootViewController = baseNavigationController;
好了,