Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

A drop-in replacement for NSFetchedResultsController built to work around the fact that NSFetchedResultsController does not work with parent/child contexts.

License

Notifications You must be signed in to change notification settings

facebookarchive/FBFetchedResultsController

Repository files navigation

FBFetchedResultsController

Build Status Coverage Status

A drop-in replacement for NSFetchedResultsController built to work around the fact that NSFetchedResultsController does not work well with parent/child contexts.

From Apple's doc on NSManagedObject:

When you save changes in a context, the changes are only committed “one store up.” If you save a child context, changes are pushed to its parent. These changes are not saved to the persistent store until the root context is saved. (A root managed object context is one whose parent is nil.) In addition, a parent does not pull changes from children before it saves. You must save a child contexts if you want ultimately to commit the changes.

See NSFetchedResultsController for documentation.

Usage

  • Use FBFetchedResultsController where you currently use NSFetchedResultsController
  • Important: Call [FBFetchedResultsController +didMergeChangesFromContextDidSaveNotification:intoContext:] any time you call [NSManagedObjectContext -mergeChangesFromContextDidSaveNotification:].

Authors

FBFetchedResultsController was written at Facebook by Nicolas Spiegelberg. The underlying helper FBModelHierarchyController was written by Todd Krabach.

License

FBFetchedResultsController is BSD-licensed. See LICENSE.

About

A drop-in replacement for NSFetchedResultsController built to work around the fact that NSFetchedResultsController does not work with parent/child contexts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published