Latest 1.1.0
License MIT
Platforms ios 7.0, osx 10.9, requires ARC
Frameworks Foundation, CoreData

NBCoreDataController is a simple and lightweight implementatoin of the elegant three-context scheme proposed by Marcus Zarra for asynchronous CoreData saving, as documented by Cocoanetics.


It provides a shared instance with a CoreData stack for the default SQLite database and model created by Xcode templates, and provides a simple API for saving data in the background.

[[NBCoreDataController sharedInstance] saveWithBlock:^(NSManagedObjectContext *localContext) {
    // Do the heavy work here
} completion:^(BOOL success, NSError *error) {
    // Do something on the main thread after the save has been completed

It also provides helpful extensions to NSManagedObject for fetching and manipulating objects on any context.


Since all changes flow from temporary background contexts through the main context up to the root (writing) context, the main context can suffer a degrade in performance for intensive writing. Also, reading from the root context will be locked while it is writing data.

For intensive reading/writing apps, or if you need something more configurable and complete, take a look into the popular MagicalRecord.

For regular data IO, this is a pretty simple architecture that’s working fine on production for Listary.

Latest podspec

    "name": "NBCoreDataController",
    "version": "1.1.0",
    "summary": "Simple and lightweight three-layer CoreData stack for asynchronous saving",
    "description": "NBCoreDataController is a simple and lightweight implementatoin of the elegantnthree-context scheme proposed by [Marcus Zarra]( nfor asynchronous CoreData saving, as [documented by Cocoanetics](",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Nuno Baldaia": "[email protected]"
    "social_media_url": "",
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": "NBCoreDataController",
    "frameworks": [
    "requires_arc": true,
    "platforms": {
        "ios": "7.0",
        "osx": "10.9"

Pin It on Pinterest

Share This