I have a JSON file. The size is around 20MB.
Project 1. So, I created a project and imported data from that JSON file to Core Data. Core Data creates the following sqlite files, entireDataList.sqlite, entireDataList.sqlite-shm and entireDataList.sqlite-wal. It took 10 minutes to copy entire content from JSON to core data and its one time file creation.
Now in Project2. I copied all the three files in MainBundle.I have to create .xcdatamodeld as if I directly copy it from Project1, it does not find the .momd file.
NSURL *storeURL = [[NSBundle mainBundle] URLForResource:@"entireDataList" withExtension:@"sqlite"];
store =[[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedModel]];
NSError *error;
[store addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error];
So, is storeURL from NSBundle mainBundle is a reliable approach, where entireDataList.sqlite, entireDataList.sqlite-shm and entireDataList.sqlite-wal files are stored?
Generally they are into documents directory.