我想要一个应该在导航控制器内的标签栏控制器。我需要将它添加为我的母版页的子视图。如果没有 ARC,此代码可以正常工作。但是在ARC时会出现黑屏。请帮帮我。
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.delegate = self;
RestaurantListingClass *restList = [[RestaurantListingClass alloc]initWithNibName:@"RestaurantListingClass" bundle:Nil];
UITabBarItem *placeTab = [[UITabBarItem alloc] initWithTitle:@"Places" image:nil tag:1];
restList.tabBarItem = placeTab;
ReOrderVC *reorder=[[ReOrderVC alloc]initWithNibName:@"ReOrderVC" bundle:Nil];
UITabBarItem *reorderTab = [[UITabBarItem alloc] initWithTitle:@"Re-order" image:nil tag:1];
reorder.tabBarItem=reorderTab;
tabBarController.viewControllers=[NSArray arrayWithObjects:restList,reorder, nil];
UINavigationController *navcontroller =[[UINavigationController alloc]initWithRootViewController:tabBarController];
DesignElementsClass *DEClass = [[DesignElementsClass alloc] init];
[DEClass setImageForsubNAvBar:navcontroller.navigationBar];
[DEClass setImageForsubTabBar:tabBarController.tabBar];
navcontroller.view.frame = view.bounds;
[self addChildViewController:navcontroller];
[self.view addSubview:navcontroller.view];