If I perform a fetch w/ a NSFetchedResultsController that returns objects and then want to clear the controller, i.e., have .fetchedObjects be an empty array, is there a method that can be called or do I have to perform another fetch that does not return any results?
You could set the fetch request of your fetched results controller to return nothing:
self.fetchedResultsController.fetchRequest.predicate =
[NSPredicate predicateWithValue:NO];
[self.fetchedResultsController performFetch:nil]
Now self.fetchedResultsController.fetchedObjects
should return an empty array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With