Table of Contents
Import Xcode Model Help
If you work extensively with databases and Apple Xcode, you may have created database models within Xcode.
This tutorial shows how to import an existing Xcode model using Valentina Studio and then automatically generate a Valentina database schema.
Step 0: Prepare Model File
You can download example model file here. It contains 4 entities: Clients, Passport, StatusCard and Order, and also 3 relationship like shown at the picture:
Step 1: Load Model File
To import xcode model to Valentina database using Valentina Studio - choose menu File, then Import Xcode Model. In the first tab of wizard you should choose xcode model file:
[New] Using xCode4 Model
If you want to open datamodel file that was created in xCode4 - select package with datamodel files with extention *.xcdatamodeld. You will see a list of models of selected package. Then - select needed file. Then - select needed file:
Press Next.
Step 2: Create Database File
Step 3: Set Link Names & Types
At last tab of wizard you can set type and name of links in the future database. In this example let's set different's types of link for each relationship:
Be attention: if you use for M:M relationship Foreign Key or Object Ptr links - a name of the link will be a name of a third table for realization M:M relationship.
Press Finish.
Step 4: Test New Database
To watch Valentina database diagram - create a new diagram for TestDatabase and choose all tables:
Now you can use this Valentina database in many ways. For example, to develop Cocoa application using XCODE using Interface Builder Plugin.