Key Value Coding 8: Accessing An Array
2006-09-11
KVO8 is a modified version of KVO6. KVO7 was a side step. In KVO8 fact it looks just like KVO6. Get it at the download page.

In KVO8 the VehicleCollection class has the NSMutableDictionaries replaced with NSMutableArrays:

The code to access the ivars in AppController is different now since the array is indexed:

The first valueForKey is used to access the NSMutableArray ivar by name, either cars or bikes. Then objectAtIndex is used to access the Vehicle in the array, and finally valueForKeyPath accesses the ivar by name. So that is three accesses to get the data.

In KVO8 the VehicleCollection class has the NSMutableDictionaries replaced with NSMutableArrays:

The code to access the ivars in AppController is different now since the array is indexed:

The first valueForKey is used to access the NSMutableArray ivar by name, either cars or bikes. Then objectAtIndex is used to access the Vehicle in the array, and finally valueForKeyPath accesses the ivar by name. So that is three accesses to get the data.
The Bagelturf site welcomes Donations of any size