Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 30. Core Data Relationships - Pg. 365

Chapter 30 C ORE D ATA R ELATIONSHIPS It is time to delve a bit deeper into Core Data. In Chapter 11, you dealt with a single entity ( Car ). In most applications, you will have multiple entities and relationships between them. Core Data supports to-one relationships and unordered to-many relationships. This exercise will have two entities: Employee and Department . An employee will work for one department. A department will have a set of employees. A department will also have one employee (chosen from its set) who will be a manager. Thus, there are three relationships, as shown in Figure 30.1. department Department deptName = @"Sales" employees manager Employee firstName = @"Barney" lastName = @"Jones" Employee