MappingModelを必要とするiOSコアデータの移行を実行しようとしています。コアデータは何らかの理由でマッピングモデルを使用できず、軽量マイグレーションへの自動移行に戻ります。コアデータ移行に適切なマッピングモデルが見つかりません
MigrationDebugオプションを有効にすると詳細が表示され、わかりやすくなります。マッピングモデルのソースハッシュと宛先ハッシュは、送信元と宛先のManagedObjectModelsに対して、順序を無視して同一です。マッピングモデルを使用する必要がありますが、ログに「適切なマッピングモデルが見つかりません」と表示されるようです。
CoreData: annotation: (migration) will attempt automatic schema migration
CoreData: annotation: (migration) looking for mapping model with
source hashes:
{
TSBaseEntity = <4797118c 50068f2f f544d9a9 4884720b 55ec7e4d 0d4c8f4e 1ee44be3 b06d2edc>;
TSBuyer = <91e837d1 3f348913 eff634d6 6fb9b3a6 747e2390 fbdc4ae6 32cc56d6 7582d4a8>;
...
}
destination hashes: {
TSBaseEntity = <4797118c 50068f2f f544d9a9 4884720b 55ec7e4d 0d4c8f4e 1ee44be3 b06d2edc>;
TSBuyer = <e316a857 8919c4be eef15387 5c67a21b 67d32919 99ead438 1ff93c05 2e065fcc>;
...
}
CoreData: annotation: (migration) checking mapping model at path file://localhost/Users/xandrews/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/0A84951E-21FC-47C0-A1B7-F880ACB672C4/Dev.app/Migrate_0_5_24To_0_5_27.cdm
source hashes:
{(
<4797118c 50068f2f f544d9a9 4884720b 55ec7e4d 0d4c8f4e 1ee44be3 b06d2edc>,
<91e837d1 3f348913 eff634d6 6fb9b3a6 747e2390 fbdc4ae6 32cc56d6 7582d4a8>,
...
)}
destination hashes: {(
<4797118c 50068f2f f544d9a9 4884720b 55ec7e4d 0d4c8f4e 1ee44be3 b06d2edc>,
<e316a857 8919c4be eef15387 5c67a21b 67d32919 99ead438 1ff93c05 2e065fcc>,
...
)}
CoreData: annotation: (migration) no suitable mapping model found
CoreData: annotation: (migration) inferring a mapping model between data models with
source hashes: ...
Xcode 4.6.2では、間違ったファイルが生成されるため、移行ツールは使用できません。 –
これが解決策であるかどうかわかりませんが、確かに解決策です。 Xcode 5によって生成されたファイルを使用すると、DP4が私にとってうまくいった。 –
Xcode 4の場合は、[この回答](http://stackoverflow.com/a/9428260/1402846)を試してください。 – Pang