mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
How to creat a FetchedResultsController? #265
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jshl8612 on GitHub (Apr 16, 2019).
Would you like to tell me the right way to make a FetchedResultsController?
let fecthController = dataStack.createFetchedResultsController(From<Food>(), SectionBy<Food>("name"), OrderBy<Food>(.ascending("foodID")))With above code, fetchedObjects is always nil.
@JohnEstropia commented on GitHub (Apr 16, 2019):
Is there any reason you prefer
NSFetchedResultsControllerinstead ofListMonitor?As for your question, there's nothing that looks wrong in your code so there must be some other problem. Are you seeing any error logs in the console?
@jshl8612 commented on GitHub (Apr 17, 2019):
Because the
ListMonitor<Food>couldn't set toListMonitor<SuperClassOfFood>.I have a
BaseViewControllercontainsNSFetchedResultsControllerto deal with most of the same job, and overriding the get function in subclass.There was no error logs in console.