To update the table view, we listened for notifications sent by the managed object context of the Core Data manager. This is a perfectly fine solution. But it can be messy to sift through the managed objects contained in the userInfo
dictionary of the notification. In a complex Core Data application, the NSManagedObjectContextObjectsDidChange
notification is sent very frequently. It includes every change of every managed object, even the ones we may not be interested in. We need to make sure we only respond to the changes of the managed objects we are interested in.
Subscribe to Cocoacasts Plus to watch this episode.
Core Data Fundamentals
Exploring the NSFetchedResultsControllerDelegate Protocol
by Bart Jacobs in Core Data
Swift 4
Xcode 9
iOS 11
Core Data Fundamentals
-
05:08
-
01:49
-
4 Exploring the Core Data Stack
06:46
-
01:06
-
6 Setting Up the Core Data Stack
08:31
-
06:41
-
11 Working With Managed Objects
08:44
-
12 Subclassing NSManagedObject
03:53
-
04:00
-
03:17
-
08:22
-
08:32
-
01:38
-
19 Exploring the NSFetchedResultsControllerDelegate Protocol
06:13
-
20 Adding Categories to the Mix
08:16
-
06:17
-
06:43
-
06:54
-
07:03
-
27 Using a Better Core Data Stack
01:10
-
08:01
-
04:27