-
Install via CocoaPods
pod 'RMCoreDataStack'
-
Import the public header
#import <RMCoreDataStack/RMCoreDataStack.h>
-
Setup your stack
self.coreDataStack = [[RMCoreDataStack alloc] init]; self.coreDataStack.delegate = self; [self.coreDataStack constructWithConfiguration:nil];
-
Grab the NSManagedObject context and start persisting!
NSManagedObjectContext context = self.coreDataStack.managedObjectContext; // pass context to your custom objects and view controllers
If you need to customize the configuration of the core data stack you can do so by creating an RMCoreDataConfiguration
and passing it to the constructWithConfiguration:
method.
To run the example project, clone the repo, and run pod install
from the Example directory first.
The BasicDemo is based on the XCode Master-Detail Application template. The only changes are in RMAppDelegate.
The project is currently configured to support iOS 7 and higher. OSX is not currently supported but it will be soon.
RMCoreDataStack is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RMCoreDataStack"
Rob MacEachern, rob@robmaceachern.com
RMCoreDataStack is available under the MIT license. See the LICENSE file for more info.