iOS Hide or remove a tab in tab based application in XCode

balanetmail

macrumors newbie
Original poster
Dec 11, 2009
2
0
Hi Guys,

I am very new to iphone and XCode i am trying to create a tab based application in that from the first page according to clicking of a button i need to remove/hide some of the tab added in the tabbar.
Can any one help me out Plz.

Thanks and Regards,
Bala.
 

KoolStar

macrumors demi-god
Oct 16, 2006
825
9
Kentucky
The buttons on the tabbar are stored an an array, all you have to do is remove the button or add a button programmatically to the array in that event action.
 

balanetmail

macrumors newbie
Original poster
Dec 11, 2009
2
0
Got the result

Got it and i used the code like...

NSUInteger indexToRemove = 3;
NSMutableArray *controllersToKeep = [NSMutableArray arrayWithArray:tabBarController.viewControllers];
UIViewController *removedViewController = [[controllersToKeep objectAtIndex:indexToRemove] retain];
[controllersToKeep removeObjectAtIndex:indexToRemove];
[tabBarController setViewControllers:controllersToKeep animated:YES];

Thanks a lot KoolStar for your replay

Now it is working....

:):):)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.