Marcin
Marcin

Reputation: 3784

need reloadData on table after every performFetch?

This my be silly question. Bu do I have to call

[table reloadData];

after every time when I call performFetch on NSFetchedResultsController to update table view?

[self fetchedResultsController] performFetch:nil];

Upvotes: 4

Views: 1195

Answers (2)

Bruno Belotti
Bruno Belotti

Reputation: 2464

If you are setting your UITableViewController as the NSFetchedResultsControllerDelegate, you can implement the controllerDidChangeContent: method:

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
   [self.tableView reloadData];
}

Take a look at this answer here at StackOverflow.

Apple documentation here

Happy coding :)

Upvotes: 1

Yama
Yama

Reputation: 2649

if the method [self fetchedResultsController] performFetch:nil]; results into new dataset, and you want to load your table with that new data, you will have to do the job.

Upvotes: 3

Related Questions