How can i define
someViewIWantToDisableOtherFor and
anotherViewIWantDisabled in the following code?
id currentlySelected; //This will hold the address of the selected view
id dontAllowSelection; //This will hold the address of the Denied view
- (BOOL)tabBarController:(UITabBarController *)tabBarControllers shouldSelectViewController:(UIViewController *)viewController
{
if (dontAllowSelection != nil &&
dontAllowSelection == viewController)
{
return NO;
}
currentlySelected = viewController;
if (currentlySelected == someViewIWantToDisableOtherFor)
{
dontAllowSelection = anotherViewIWantDisabled;
}
else
{
dontAllowSelection = nil;
}
return YES;
}
Not enough information. You’re asking how to get pointers to two views, but those views could come from anywhere. The view controller might have them already as IBOutlets, or it might find them using their
tagvalue, or the user might touch one or both of them…