I am not sure wether my query is wrong or something in MagicalRecord.
Here's my fetchedResultController:
let predicate = NSPredicate(format: "(ArticleAttributes.published_at.rawValue) >= %@", NSDate().dateBySubtractingDays(20))
let fetchController = Article.MR_fetchAllSortedBy("published_at", ascending: false, withPredicate: predicate, groupBy: nil, delegate: nil)
The first page in my tableview is properly ordered, but when I fetch the next page, the NSFetchedResultsControllerDelegate fail to insert new rows because the indices are all in wrong order.
If I set the ascending to true, my tableview gets populated using NSFetchedResultsControllerDelegate, but I want my most recent article on top.
I am not sure wether my query is wrong or something in MagicalRecord. Here's my fetchedResultController: let predicate = NSPredicate(format: "(ArticleAttributes.published_at.rawValue) >= %@", NSDate().dateBySubtractingDays(20)) let fetchController = Article.MR_fetchAllSortedBy("published_at", ascending: false, withPredicate: predicate, groupBy: nil, delegate: nil)
The first page in my tableview is properly ordered, but when I fetch the next page, the NSFetchedResultsControllerDelegate fail to insert new rows because the indices are all in wrong order. If I set the ascending to true, my tableview gets populated using NSFetchedResultsControllerDelegate, but I want my most recent article on top.