을 선택 않습니다는 왜 tabbarController 지수를 프로그래밍 방식 나던 통화 위임 방법
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController;
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;
하지만 시도 즉, 프로그래밍 같은 일을 할 수
[self.tabbarController setSelectedIndex:selectedIndexNo];
또는
[self.tabBarController setSelectedViewController:[self.tabBarController.viewControllers objectAtIndex:0]];
는 대리자 메서드가 호출되지 않습니다. 그 이유는 무엇입니까?
난 내가 그렇게 할 수 알지만, 왜 것으로 생각되는 방식으로 작동 나던? – yunas
이것이 작동하는 방식입니다. –
당신은 위임자 메소드를 직접 호출 할 수 있습니다.하지만 올바른 일은 아니지만 우연히 할 수 있습니다. [self.tabbarController setSelectedIndex : selectedIndexNo]; [YourViewControllerObject tabBarController : self.tabBarController didSelectViewController : [self.tabBarController.viewControllers objectAtIndex : selectedIndexNo] – Haider