Доброе утро, я пытаюсь скрыть UITabBarItem, и после того, как прочитал много сообщений здесь, я схожу с ума ... Я могу получить tabItem правильно, но он не скрывается. Я настраиваю TabBar в Storyboard.UITabBarItem Show/Hide
Вот мой code..none из 3-х вариантов я пытался работы ...
Любой помогает будет оценено
@implementation unidaAppDelegate
@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
self.tabBarController = [storyboard instantiateViewControllerWithIdentifier:@"myTab"];
NSMutableArray *tabs = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
NSLog(@"Array:%@",tabs);
/*
OPTION 1
NSMutableArray *viewControllersCopy = [[self.tabBarController viewControllers] mutableCopy];
[viewControllersCopy removeObjectAtIndex:2];
NSArray *modifiedViewControllers = [[NSArray alloc] initWithArray:viewControllersCopy];
[self.tabBarController setViewControllers:modifiedViewControllers animated:NO];
OPTION 2
NSMutableArray *modifyMe = [[self.tabBarController.tabBar items] mutableCopy];
[modifyMe removeObjectAtIndex:2];
NSArray *newItems = [[NSArray alloc] initWithArray:modifyMe];
[self.tabBarController.tabBar setItems:newItems animated:true];
OPTION 3
NSLog(@"TabBarItem: %@",[[self.tabBarController.tabBar.items objectAtIndex:2] title]);
[[self.tabBarController.tabBar.items objectAtIndex:2] setEnabled:FALSE];
*/
sleep(1);
return YES;
}
Спасибо, ClOck, так я это сделал, но UITabBarItem сопротивляется, чтобы скрыть .... – Christian