Key Value Coding 9: Getting An Array

KVC can be used to get an entire array of values at once. Download KVO9 and look at it. KVO9 adds a new ivar, called type:
KVO9-1
The VehicleCollection class does away with the two NSMutableArrays and replaces them with one:
KVO9-2
and Vehicle now includes the type as an ivar:
KVO9-3
These changes mean that AppController can now access an entire array of ivars with a single key path:
KVO9-4
Look carefully at what happened there. The key path collection.paint when accessing mytoys returns an array of paint strings, one per Vehicle in the VehicleCollection object. So now KVC is saving us iteration over arrays by doing all the message passing and result collection for us. This works because collection is an NSMutableArray. That's very different from the way that NSMutableDictionaries work on this situation.
The Bagelturf site welcomes Donations of any size