figure 6.1 118 hour 6:working with the core data model editorptgmedia.pearsoncmg.com › images ›...
TRANSCRIPT
118 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.1Create a newiOS project anduse Core Data.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 118
Adding Entities to the Data Model 119
FIGURE 6.2Create a newMac OS projectand use CoreData.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 119
120 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.3Take a look atwhat Xcode hasbuilt for you.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 120
[(H3F)] 121
FIGURE 6.4Open the CoreData modeleditor.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 121
122 [(H1F)]: [(H2F)]
FIGURE 6.5Examining atemplate for aMac OS app.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 122
Adding Entities to the Data Model 123
FIGURE 6.6Create a newentity.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 123
124 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.7Name the newentity.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 124
Adding Entities to the Data Model 125
FIGURE 6.8Add a newattribute.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 125
126 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.9Review errorsas they arise.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 126
Choosing the Editor Style 127
FIGURE 6.10Name theattribute andset its type.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 127
128 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.11Use grid editorstyle.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 128
Adding Relationships to a Data Model 129
FIGURE 6.12Add attributes,relationships,or fetched prop-erties in grideditor style.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 129
130 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.13Draw a relationship.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 130
Adding Relationships to a Data Model 131
FIGURE 6.14Release themouse buttonto complete therelationship.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 131
132 HOUR 6: Working with the Core Data Model Editor
FIGURE 6.15Add a relation-ship in tableeditor style.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 132
[(H3F)] 133
FIGURE 6.16Name andspecify the cardinality of the relationships.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 133
134 [(H1F)]: [(H2F)]
FIGURE 6.17Double-headedarrows indicatea to-many relationship.
06_9780672336195_ch06.qxd 6/13/12 1:01 PM Page 134