views:

47

answers:

2

Hi, I have a tabbar with one of the tabs containing a drilldown table.

I am having problems once the user has finished using the drilldown table. If they change to another tab, then change back to the original tab, the original tab is still where I left it (at the bottom of the drill down showing the detail view)

What I want is on moving to an alternative tab the old tab resets

I have tried adding all sorts of stuff to -(void)viewDidDisappear and -(void)viewDidUnload with no success

What do I need to do?

Cheers

A: 

bump.

anyone?

Any suggestions would be appreciated.

Bob
+1  A: 

Hi bob

As i understood your ques. you want the first view on everytab,whenever you move through tabs.you don't want the old view to be displayed there which you had left. Here is the code just use that in ur appdelegate file

  • (void)tabBarController:(UITabBarController *)tabBarController1 didSelectViewController:(UIViewController *)viewController{ NSArray *vc= tabBarController1.viewControllers; for (int i = 0; i < [vc count]; i++) { UINavigationController *nc = [vc objectAtIndex:i]; if (nc == tabBarController1.selectedViewController) { continue; } [nc popToRootViewControllerAnimated:NO]; }

}

If it helps you then please vote up for me.

sabby