Key Value Coding 5: Adding valueForKeyPath

Download the code for KVO5. KVO5 looks just like KVO4:
KVO5-1
And it does the same thing. The only difference is in the way that AppController accesses the ivars. Here is the new code:
KVO5-2
And here is the code from KVO4:
KVO4-3
KVO5 uses valueForKeyPath once instead of valueForKey twice. If the user types in "paint", it takes "suv" and "paint" and concatenates them with a period to get "suv.paint" and passes that to keyValueForPath. That path is parsed with the first part being applied to the NSDictionary to get the Vehicle and the second part being passed to the Vehicle to get the ivar. It's all done behind the scenes.
The Bagelturf site welcomes Donations of any size