Building Our Own: MSZContextWatcher

Since the introduction of the NSFetchedResultsController, I’ve run into numerous situations in which I wanted to use its ability to detect data changes even when I wasn’t using a UITableView. Building a user interface for an iPad where three different entities are being displayed at once is a situation that begs for some kind of watcher to notify the user interface when the data has changed. Needing to watch not just a single type of entity but also relationships associated with that entity is another place where an observer is useful. Frequently I’d attempt to use an NSFetchedResultsController and run into one problem or another that made it more difficult than it needed to be. This led me to investigate ...

Get Core Data in Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.