2012-01-23 3 views

답변

5

당신은으로 UITabBarController가의 대리자를 사용하여이 작업을 수행 할 수 있습니다 -

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController 
{ 
    if ([tabBarController selectedIndex] == 2) 
    { 
     NSMutableArray *arr = [[NSMutableArray alloc] initWithArray:[tabBarController viewControllers]]; 

     NewViewController *nvc = [[NewViewController alloc] init]; 

     [arr replaceObjectAtIndex:1 withObject:nvc]; 

     [nvc release]; 

     [tabBarController setViewControllers:arr]; 
    } 
} 
+0

감사합니다 ... 나는 생각이있어 .. – DipakSonara