0

Is it possible to load an existing core data database into an app and access it like a normal core data store if I don't have the corresponding .xcdatamodeld file? Is there a possibility to rebuild a fitting .xcdatamodeld from the database? Either per hand or programmatically? Thanks for your help

4

1 回答 1

0

If you have access to the Core Data database file generated by Core Data from the datamodel you don't have, it is a Sqlite database you can open in an Sqlite database browser. You may be able to inspect it and make queries into it, and possibly recreate a datamodel similar to it, but you will probably have to trick Core Data into thinking it's the same version as the original datamodel by copying the information in the version table from a database file created by Core Data with your new datamodel into the old database file.

于 2013-03-30T17:47:00.787 回答