November 2013
Beginner
325 pages
9h 47m
English
Most applications end up with a relatively complex object graph. For example, you might have a BNRDepartment object that has a manager property that is a pointer to an BNREmployee object which has an emergencyContact property which is a pointer to a BNRPerson object which has a phoneNumber property.
Figure 35.1 Complex object graph
Imagine that you are asked, “What is the phone number of the emergency contact for the manager of the sales department?” You could use key-value coding to traverse these relationships one at a time:
BNRDepartment *sales = …; BNREmployee *sickEmployee = [sales valueForKey:@"manager"]; ...
Read now
Unlock full access