1

I am writing an app that pulls information from a database, displays in a table, and allows the user to get details by selecting an item from the table. Whenever the table updates, the values in the list are correct, but the table displays the old information (i.e. if the table originally had 3 items and now has 2, the table will display the original 3 items, but break if the user tries to tap the 3rd item). The same issue occurs with my details view. If the user selects one value, the view changes for that information. If they navigate back and select a new value, the view changes but displays the information from the first selection. I've attributed both of these to the views not calling viewDidAppear when they appear. I am using a Navigation Controller to load the views, but they still aren't calling the method.

This is how I show my listView : UITableViewController

-(IBAction)viewInventoryClicked:(id)sender {
    [DBHelper getAllBottles:[appDelegate getDBPath]];
    if(self.viewList == nil) {
          //instantiate view
    }

    [appDelegate.navigationController viewWillDisappear:YES];
    [appDelegate.navigationController pushViewController.self.viewList animated:YES];
}

My detailsView (UIViewController) is shown in a similar fashion. The navigation controller resides in the AppDelegate. The main window is loaded with:

[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];

The mainWindow and my ModalView are both successfully calling the viewDidAppear methods. I am completely stumped on why these other two are not calling them. Thanks in advance for the help.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Bic
  • 3,141
  • 18
  • 29

1 Answers1

0

I figured it out. The issue wasn't in the way I was changing view, but in the way my interfaces were set up. I had all of my viewControllers in my MainWindow.xib, instead of the in the *.xib of the view previous.

Bic
  • 3,141
  • 18
  • 29