0

I need help in following scenario.

I am building an app that displays tableview. If the user tap an entry it goes to the detailed screen. In the detail screen, I have a button to delete this entry. It deletes the entry from the data source and dismiss the modal.

But after dismissing the modal, table view data is not refreshing.

If I go back to parent view controller and then again come back to child screen, it refreshes the count.

I read few similar posts and found the following solution.

[tableview reloadData];

Or

[self.tableView reloadData];

In - (void)viewDidAppear:(BOOL)animated of child screen. But its not refreshing the table view.

Please help.

A.S.
  • 320
  • 3
  • 11
  • Got the answer from .....http://stackoverflow.com/questions/8437423/tableview-reloaddata-does-not-work – A.S. Mar 13 '12 at 05:36

3 Answers3

0

For completeness, the full implementation would be:

- (void)viewWillAppear:(BOOL)animated
{
    // Do stuff like reload the tableview data...
    [self.tableView reloadData];
}

If it's not working you have a problem elsewhere in your code.

aquraishi
  • 127
  • 9
0

Go through this code:

- (void)viewWillAppear:(BOOL)animated
{ 
    [self.tableView reloadData];
}
Artem Shmatkov
  • 1,434
  • 5
  • 22
  • 41
0

If the tableview is in the parent viewcontroller, I suggest that placing reloadData: method at viewWillAppear: of the parent.

(void)viewWillAppear:(BOOL)animated
{
    [self.tableView reloadData];
}

I'm sure that the method will be called when the detailed viewcontroller dismissed.

Kyokook Hwang
  • 2,682
  • 21
  • 36