i have some difficulties changing tab bar controllers. Basically I have UITabBarController with 3 controllers. First time when app starts. I change one controller like this:
First I assume you meant:
[self.tabBarController setSelectedIndex:1];
Failing that it sounds like the problem is with your _tabBarControllers.
what do the following output:
NSLog(@" _tabBarControllers count = %d", [_tabBarControllers count]);
NSArray* newArray = [NSArray arrayWithArray:self.tabBarController.viewControllers];
NSLog(@" newArray count = %d", [newArray count]);
EDIT: Does the following successfully remove the first tab with no problems?
NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
[newArray removeObjectAtIndex:0];
[self.tabBarController setViewControllers:newArray animated:YES];
EDIT 2 :
try changing:
[muteArray addObjectsFromArray:_navigationCotroller.viewControllers];
online.tabBarControllers = [muteArray copy];
[muteArray replaceObjectAtIndex:1 withObject:online];
to:
[muteArray addObjectsFromArray:self.tabBarController.viewControllers];
[muteArray replaceObjectAtIndex:1 withObject:online];
online.tabBarControllers = [muteArray copy];
To be honest I'm finding it hard to follow your app structure and object references.