Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

temm

macrumors newbie
Original poster
May 19, 2009
14
1
Hi,

I have tabbar app with 2 tabs. Both tabs have tableViewControllers

On the first tab i have i list of sources and selecting one source from the first tab on the second tab the details of the selected source are showen in the tableView

On the second tab i also use a navigationController where i can drill down to show more details on the selected items.

Everything works (well not everything) and the problem is when i go back to the first tab and select another source i should be able to see the details on the second.

On the second viewController i have

- (void)viewWillAppear:(BOOL)animated {

[self.navigationController popToRootViewControllerAnimated:NO];

[self.tableView reloadData];
}

All the pushed ViewControllers get poped of the stack but it's shows the details of the previous source and not the last selected one.

I can see that reloadData is working and loading the actuall data but i cannot view it.

Can i call the popToRootViewControllerAnimated from the first tab and how, or am i doing something completely wrong?

Teo
 

temm

macrumors newbie
Original poster
May 19, 2009
14
1
I managed to solve the problem.

I was able to popToRootViewController from the second tab using this.

SimpleTabBarAppDelegate *appDelegate = (SimpleTabBarAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.myNavigationController popToRootViewControllerAnimated:NO];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.