I have a NSFetchedResultsController to get the data for an UITableView. During the creation of the NSFetchedResultsController I create a NSPredicate that filters the data with an external condition. What’s the proper way to refetch the data? Just nil’ing the my __fetchedResultsController and recreating it seems a little bit brutal.
Thanks!
As indicated in my comment above I figured it out. What you need to do is save a reference to the
NSFetchRequestand manipulate that straight away when needed. As a second step, you need to tell yourNSFetchedResultsControllerto fetch it’s data again.I did this by adding two new methods to the default
NSFetchedResultsController“stack”:So what I basically do now is call these two methods on creation of
__fetchedResultsController(which I do initialize using__fetchRequest, of course) and every time my external dependency changes. That’s it.