Open jshl8612 opened 5 years ago
Is there any reason you prefer NSFetchedResultsController
instead of ListMonitor
?
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?
Is there any reason you prefer
NSFetchedResultsController
instead 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?
Because the ListMonitor<Food>
couldn't set to ListMonitor<SuperClassOfFood>
.
I have a BaseViewController
contains NSFetchedResultsController
to deal with most of the same job, and overriding the get function in subclass.
There was no error logs in console.
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.