Database Reference
In-Depth Information
The attributes mappings here are fairly straightforward. Notice the value
expressions with the pattern $source . The $source is a special token for the
mapping model editor, representing a reference to the source instance. Remember,
with Core Data, you're not dealing with rows and columns in a database. Instead,
you're dealing with objects, their attributes and classes.
In this case, the values for body , dateCreated , displayIndex and title will be
transferred directly from the source. Those are the easy cases!
The attachments relationship is new, so Xcode couldn't fill in anything from the
source. You'll get to that shortly.
Select the Attachment mapping and make sure the Utilities panel on the right is
open. Select the last tab in the Utilities panel to open the Entity Mapping
inspector:
Change the Mapping Name to NoteToAttachment . This mapping name
convention (also used by default Core Data mappings) indicates that data for the
new Attachment entity will come from Note. Select Note as the source entity in the
drop-down list. Once you select the source entity, Xcode will try to resolve the
mappings automatically based on the names of the attributes of the source and
destination entities. In this case, Xcode will fill in the dateCreated and image
mappings for you:
 
Search WWH ::




Custom Search