You can debug the migration process by adding the launch argument -com.apple.CoreData.MigrationDebug 1 to your application. It should print out quite a bit of information.
In my case, my PropertyManager*-*.xcmappingmodel files are listed in the “Compile Sources” build phase for my application, so I can only assume they end up in the main application bundle.
The error message you are receiving is given when there is no migration found from the current Core Data model to some other Core Data model. This may happen if you accidentally modified one of the intermediate managed object models. I suggest you start with the above debug information and try to find out how far it is getting through the migration process.
Feel free to provide more details and I’ll see what I can do to help.
Thanks for helping. In the app I have now, I am running two mapping models to go from version 1→2→3. Using your debugging suggestion I found half of my hash tags in both the source and destination do not match.
ie: Version 1 test File Source does not match 1st Mapper Source (1→2)
Version 2 test File Source does not match 2nd Mapper Source (2→3)
I’m guessing this is why I get “No Mapping Model found”. Is there a way to fix the hash tags?
@Jo3rw The hash tags come from the models themselves. You might want to try recreating any mapping models with invalid hash tags.
Bill
(from San Diego, CA)
said:
Wed, 20 Mar 2013 at 07:50AM
Thanks for the sample code. In my sandboxed app I too had the problem of savepanel.url returning nil. After some experimenting, I thought I’d try passing the same URL to both arguments of the migrationController in makeDocumentWithContentsOfURL like this:
if ([migrationController migrateURL:url toURL:url error:outError])
And it worked! No savepanel needed!
I should also mention that is being discussed on the Apple dev forums.
Dirk
(from Germany)
said:
Mon, 14 Oct 2013 at 01:24AM
Thanks for the good work. It helped me a lot. Two things I find out:
First, the save panel delivers url as nil in a sandbox. It looks like, that the sandbox does not like to initialize the directory url with a file path. You have to set the following:
Comments
Hi Samuel,
Is there a trick to where the mapping model should be? or a naming convention that should be used for the mapping models?
I keep triggering the “No mapping model found!” NSLog.
I know the models work since I can migrate when using temporary entitlements. I just can’t figure out how to make the program manually find them.
Hi Jo3rw,
You can debug the migration process by adding the launch argument
-com.apple.CoreData.MigrationDebug 1to your application. It should print out quite a bit of information.In my case, my
PropertyManager*-*.xcmappingmodelfiles are listed in the “Compile Sources” build phase for my application, so I can only assume they end up in the main application bundle.The error message you are receiving is given when there is no migration found from the current Core Data model to some other Core Data model. This may happen if you accidentally modified one of the intermediate managed object models. I suggest you start with the above debug information and try to find out how far it is getting through the migration process.
Feel free to provide more details and I’ll see what I can do to help.
Kind regards,
Samuel
Hi Samuel,
Thanks for helping. In the app I have now, I am running two mapping models to go from version 1→2→3. Using your debugging suggestion I found half of my hash tags in both the source and destination do not match.
ie: Version 1 test File Source does not match 1st Mapper Source (1→2)
Version 2 test File Source does not match 2nd Mapper Source (2→3)
I’m guessing this is why I get “No Mapping Model found”. Is there a way to fix the hash tags?
@Jo3rw The hash tags come from the models themselves. You might want to try recreating any mapping models with invalid hash tags.
Thanks for the sample code. In my sandboxed app I too had the problem of savepanel.url returning nil. After some experimenting, I thought I’d try passing the same URL to both arguments of the
migrationControllerinmakeDocumentWithContentsOfURLlike this:And it worked! No savepanel needed!
I should also mention that is being discussed on the Apple dev forums.
Thanks for the good work. It helped me a lot. Two things I find out:
First, the save panel delivers url as
nilin a sandbox. It looks like, that the sandbox does not like to initialize the directory url with a file path. You have to set the following:if ([url isFileURL]) { homeURL = [url URLByDeletingLastPathComponent]; } savePanel.directoryURL = homeURL; savePanel.nameFieldStringValue = [url lastPathComponent];and it will work now.
At at second, you have to set the storeType explicit to
NSSQLiteStoreType, if you use SQLlite storage. This worked fine for me.Please note, you can leave a comment that uses (limited) XHTML and Textile syntax.