Copy iPhone CoreData files from one project to another

I am trying to create 2 applications that build a permanent store, and another that consumes it.

So far, I have created one application that uses CoreData to successfully build a database from an XML file. Thus, this project contains a data model, .h / .m files for objects, etc.

Now I am trying to include a second application to read this .sqlite file by copying the data model file, the .h / .m files associated with the objects and sqlite file into this project (by adding an existing one).

Code is being executed, but it is not always possible to find any objects in the database.

Are there any restrictions or the right steps when trying to copy these files?

+5
source share
5 answers

The solution here is deceptively simple.

Just copy the .xcdatamodel file from one project to another, and then when you first run your application in the simulator, it will create a Documents folder for the application. Just drop the saved .sqlite or .binary files into the yourApp / Documents directory on the device. You can find the simulator directory in "~ user / Library / Application Support / iPhone Simulator".

You can also download, edit, and download the myApp directory on your prepared iPhone by dragging and dropping from Organizer. See the list of applications.

iPhone xml , sqlite (). sqlite, , , .

, ?

+3

( 100 ) , , , , ...

0

, , . iPhone "", , .

0

, ? , -, , .

0

, coredata , . coredata , , .

0

All Articles