Skip to content

Everything you need to set up a Core Data stack on top of an SQLite persistent store and begin interacting with it. Just add data model.

License

Notifications You must be signed in to change notification settings

jdriscoll/JCDCoreData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCDCoreData

Everything you need to set up a Core Data stack on top of an SQLite persistent store and begin interacting with it. Just add data model.

Configuration

Out of the box JCDCoreData assumes your data model is named "Model". It also assumes you're using mogenerator (https://github.com/rentzsch/mogenerator) and/or your models' entity names match their class names.

Getting Started

  1. Create a new project (make sure 'Use Core Data' is not checked) and drag JCDCoreData.h/m into the source list
  2. Add the CoreData framework to your new project
  3. Add a data model to your project and name it "Model"
  4. Add some entities
  5. Select your entities and click "Editor", then "Create NSManagedObject Subclass..." (or use mogenerator)

Usage

// Get a managed object context
NSManagedObjectContext *context = [JCDCoreData defaultContext];

// Add a new entity
MyEntity *entity = [MyEntity newObjectInContext:context];

// Fetch existing entities
NSArray *entities = [MyEntity fetchAllInContext:context];

See JCDCoreData.h for all available helper methods.

About

Everything you need to set up a Core Data stack on top of an SQLite persistent store and begin interacting with it. Just add data model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published