I am learning to use Core Data. I have created a data model etc and have been inserting items using NSManagedObjectContext and NSManagedObject.
I have noticed something though – I didn’t have to create any db.
So why question is – when I create the data model – is that actually creating the db i.e. is that all there is to it? It seems so much simpler than using SQlite – reminds me of creating Access db’s.
This is roughly what core data does when your application runs:
NSManagedObjectModelNSPersistenceStoreCoordinatorwill be created tied to this model.NSPersistenceStoreobjects which handle the files.NSManagedObjectContextwill be created and tied to theNSPersistenceStoreCoordinator.The code to do all this is straightforward and when you create an application project that uses Core Data it’s already implemented in your main class. Just look at how the template does this and you can easily modify it (for example change the store type/location).