NSPrivateQueueConcurrencyType and NSFetchedResultsControllers?

I've been using Core Data for awhile, but I haven't been using the new queue aspects so I'm trying to update my knowledge.


For the Main queue (

NSMainQueueConcurrencyType
), the docs say:


You use this queue type for contexts linked to controllers and UI objects that are required to be used only on the main thread.


I just want to double check: If I'm using NSFetchedResultsControllers to power the UITableDataSource for my UITableViewControllers, do I need to use a MainQueue for my context? Or is NSFetchedResultsController smart enough to be attached to a PrivateQueue context put issue the proper object notifications on the main UI thread?


Kenny

Replies

NSFetchedResultsController has no reason to make guesses about what context or queue it should be generating updates on.


So you've got two choices:

1. Use NSMainQueueConcurrencyType

2. Write all of your NSFetchedResultsControllerDelegate methods to dispatch onto the main queue.


If you hook up an NSFetchedResultsController directly to a UITableViewController, see choice #1.

The question is whether for a tableView or collectionView, we have to use NSMainQueueConcurrencyType ? Since as mentioned here, https://forums.developer.apple.com/message/393419#393419


Using NSMainQueueConcurrencyType blocks UI when we are trying to save big amounts of data into the core data