JSONファイルがあります。サイズは約20MBです。
プロジェクト 1. そこで、プロジェクトを作成し、その JSON ファイルから Core Data にデータをインポートしました。Core Data は、次の sqlite ファイルを作成します。コンテンツ全体を JSON からコア データにコピーし、そのファイルを 1 回作成するのに 10 分かかりました。
現在、Project2 に入っています。MainBundle の 3 つのファイルすべてをコピーしました。Project1 から直接コピーしたかのように .xcdatamodeld を作成する必要がありますが、.momd ファイルが見つかりません。
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];
それで、NSBundle mainBundle からの storeURL は信頼できるアプローチであり、wholeDataList.sqlite、wholeDataList.sqlite-shm、および wholeDataList.sqlite-wal ファイルが保存されますか?
通常、それらはドキュメント ディレクトリにあります。