TableView reloadData and NavigationView

Discussion in 'iOS Programming' started by temm, May 30, 2010.

  1. temm macrumors newbie

    Joined:
    May 19, 2009
    #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
     
  2. temm thread starter macrumors newbie

    Joined:
    May 19, 2009
    #2
    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];
     

Share This Page