I have a fetched results controller which isn't calling its' delegate when it has a predicate. The predicate is to only include Conversation objects which have events
:
let predicate = NSPredicate(format: "events.@count > 0")
let fetchRequest = Conversation.MR_requestAllSortedBy(
"mostRecentMessage.eventDate",
ascending: false,
withPredicate: predicate)
self.fetchedResultsController = NSFetchedResultsController(
fetchRequest: fetchRequest,
managedObjectContext: MagicalRecordStack.defaultStack()!.context,
sectionNameKeyPath: nil,
cacheName: nil)
self.fetchedResultsController.delegate = self
self.fetchedResultsController.MR_performFetch()
This works for an initial fetch, but upon data being added, it doesn't call the delegate. Upon removing the predicate, it does call the delegate.
Is there another way I should be doing this?
events.@count > 0
? – FreeNicknameperformFetch
), it updates showing the added data. – Andrew