I am trying to figure out how to check which uitabbarbutton is currently selected before I let a user select another I would like them to deselect their previously chosen button.
This is the code that I am using to see which button gets selected..
#pragma TabBardelegatesht
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
switch (item.tag) {
case 0:
{
NSLog(@"item 0 selected");
}
break;
case 1:
{
NSLog(@"item 1 selected");
}
break;
case 2:
{
NSLog(@"item 2 selected");
}
break;
case 3:
{
NSLog(@"item 3 selected");
}
break;
case 4:
{
NSLog(@"item 4 selected");
}
break;
case 5:
{
NSLog(@"item 5 selected");
// set up or remove jumpBar
[self jumpBarButtonPosition:1];
}
break;
default:
break;
}
}
so the question is, how do I stop another selection if a cell is selected and its not the one you are currently pressing?
any help would be hugely appreciated.