Core DataとiCloudを使用して複数のiPads間でデータを同期するアプリケーションに取り組んでいます。これはすべて正常に動作していると私は各iPadにデータを追加することができますし、それらの間ですべての同期されます。Core DataとiCloud Pre-Populated sqliteファイルを追加する
私はCore Data sqliteファイルを持っています。このファイルには国のリストがあらかじめ入力されています。これをアプリケーションの最初の実行時にドキュメント領域にコピーします。私はこれを動作させましたが、persistentStoreCoordinatorの実装を変更してiCloudサポートの有無をテストし、その他いくつかの小さな変更を加えました。私はsqliteのファイルが存在するかどうかを確認し、それは私が
[psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[NSURL fileURLWithPath:iCloudData] options:options error:&persistentStoreError];
NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:: CoreData: Ubiquity: An error occured while setting up the ubiquity integration: Error Domain=NSCocoaErrorDomain Code=134316 "The ubiquity container does not appear to match this persistent store, it is possible this is caused by switching to a different iCloud account, or logging out of iCloud entirely. The store should be re-opened with read-only attributes or removed from iCloud syncing permanently." UserInfo=0x1cb590 {storeUUID=31381598-EAFA-4550-9B96-F501800974D5, containerUUID=E3A8DC7D-41FD-405A-8D8A-C06C8B467CA2, NSLocalizedDescription=The ubiquity container does not appear to match this persistent store, it is possible this is caused by switching to a different iCloud account, or logging out of iCloud entirely. The store should be re-opened with read-only attributes or removed from iCloud syncing permanently.}
で次のエラーを取得しない場合は事前にsqliteのファイルをコピーする場合がありますので、しかし
は今、これですiCloudで、別のCore Data sqliteファイルまたはトランザクションログファイルへの参照がまだありますか?もしそうなら、どうすればそれらを取り除くことができますか?
説明のための多くのおかげで、私は唯一のplistをより効率的になり、最初の起動時にcoredataに自分の緯度&長い二のと一緒に国(200&何か)のリストをインポートする必要がありますsqliteファイルをバンドルし、migratePersistentStoreを使用するよりも? –
ええ、plistははるかに簡単です。まだインポートされていないことを忘れないでください。 –
こんにちは、最初に実行するときにストアをテストするためにどのメソッドを使用する必要がありますか、また、ネストされたデータのJSONファイルがあります。 –