按下按钮后,我在控制台中收到此错误。
对 < UITabBarController: 0xcb3a330 > 的开始/结束外观转换的不平衡调用。
我的代码是
-(IBAction)push:(id) sender {
UITabBarController *tabbar1 = [[UITabBarController alloc] init];
firstViewController *first = [[firstViewController alloc] initWithNibName:@"firstViewController" bundle:nil];
UINavigationController *tabItem1 = [[UINavigationController alloc] initWithRootViewController: first];
secondViewController *second = [[secondViewController alloc] initWithNibName:@"secondViewController" bundle:nil];
UINavigationController *tabItem2 = [[UINavigationController alloc] initWithRootViewController: second];
tabbar1.viewControllers = [NSArray arrayWithObjects:tabItem1, tabItem2,nil];
[self.view insertSubview:tabbar1.view belowSubview: first.view];
[self presentModalViewController:tabbar1 animated:YES];}
第一个ViewController 是 UITableViewController
我试图将自我设置为[self.tabBarController presentModalViewController:tabbar1 animated:YES];
但还是一样
任何的想法 ?
更新 :
我找到了解决方案,我刚刚删除了这行代码
[self.view insertSubview:tabbar1.view belowSubview: first.view];
一切都很顺利:)