0
如何定義 someViewIWantToDisableOtherFor和 anotherViewIWantDisabled在下面的代碼中?iphone應用程序的tabbar
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;
}