I'm really stuck here with upgrade testing from v1 to v2 of an iPhone application. I have IPA releases that I'm testing via ad hoc distribution via iTunes to my iPhone device, one for v1 of the app and one for v2. Note that:
A snippet from the error...*
reason=**Can't find model for source store**}, {
URL = "file://localhost/var/mobile/Applications/AAAAF424-D6ED-40FE-AB8D-66879386739D/Documents/MyApp.sqlite";
metadata = {
NSPersistenceFrameworkVersion = 320;
<cut>
Question - Any ideas how to resolve this? What debugging/analysis could I do here? Let me know if you need any more info.
What I have done as an overview is:
PS fuller version of error if this helps - this time it comes from simulating the migration error on the simulator
, reason=Can't find model for source store}, {
URL = "file://localhost/Users/greg/Library/Application%20Support/iPhone%20Simulator/4.3.2/Applications/69FDFDCF-631D-4191-B852-CD75151B1EA9/Documents/MyApp.sqlite";
metadata = {
NSPersistenceFrameworkVersion = 320;
NSStoreModelVersionHashes = {
Config = <5f92f988 71e11a66 554ae924 61887562 22b8de8a c318b110 e3e4a569 81adafa2>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "3B9832DA-E3A1-431B-83E8-43431A7F3452";
};
reason = "Can't find model for source store";
}
PSS. If this helps the contents of the core data model *.mom directory/package for each version archieve are:
v1
-rw-r--r-- 1 greg staff 1664 5 Sep 21:06 MyApp.mom
-rw-r--r-- 1 greg staff 2656 5 Sep 21:06 MyApp.omo
-rw-r--r-- 1 greg staff 480 5 Sep 21:06 VersionInfo.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
<key>NSManagedObjectModel_CurrentVersionName</key>
<string>MyApp</string>
<key>NSManagedObjectModel_VersionHashes</key>
<dict>
<key>MyApp</key>
<dict>
<key>Config</key>
<data>
X5L5iHHhGmZVSukkYYh1YiK43orDGLEQ4+SlaYGtr6I=
</data>
</dict></dict></dict>
</plist>
v2
-rw-r--r-- 1 greg staff 497 2 Oct 12:47 MyApp 1.mom
-rw-r--r-- 1 greg staff 1601 2 Oct 12:47 MyApp 2.mom
-rw-r--r-- 1 greg staff 1695 2 Oct 12:47 MyApp.mom
-rw-r--r-- 1 greg staff 2920 2 Oct 12:47 MyApp.omo
-rw-r--r-- 1 greg staff 665 2 Oct 12:47 VersionInfo.plist
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
<key>NSManagedObjectModel_CurrentVersionName</key>
<string>MyApp</string>
<key>NSManagedObjectModel_VersionHashes</key>
<dict>
<key>MyApp</key>
<dict>
<key>Config</key>
<data>
Z/n8092QBHPfBwInZvIm1lei53T1UtZhpNzjl3JA0gs=
</data>
</dict>
<key>MyApp 1</key>
<dict/>
<key>MyApp 2</key>
<dict>
<key>Config</key>
<data>
Fih24clI+kZszFd3X6Gm8itq8YDxudiKnjHW8ydNmps=
</data>
</dict></dict></dict>
</plist>
EDIT: Another question that is not clear to me, as raised by reviewing the link jrturton provided below is:
You set the version of your data model in the Utilities inspector (right hand pane), under the Identity and Type tab when the xcdatamodeld file is selected. This has a section called "Core Data Model", and a field called "Identifier".
You add a new model version by selecting the xcdatamodeld file, the going to Editor --> Add model version.
At this point it prompts you for the previous model to base it on.
If youve added a new model without going through this process the lightweight migration may not work.