On Feb 28, 2012, at 10:47 AM, Per Bull Holmen wrote:

> Binding to the VALUES did still turn out pretty well now. But the
> Audio Unit plugin API also has a standardized way for Audio Units to
> give the hosts and GUI some static information about each parameter
> such as min/max value, readonly or writable etc. To be able to bind to
> this information too, it would be much easier for me to let the
> controller just fetch this information on the fly, and notify
> observers the few times it changes. Building a tree in memory would
> require more bookkeeping, and would be harder because the controller
> can not know in advance what string keys (which maps to parameters
> IDs) it will be queried for, the controller is supposed to not have
> any knowledge in advance of the possible model keys. But yeah, I'll
> solve it either way. So now I know, there is no shortcut, I must make
> every property on the key path KVC and KVO compliant. I'm not
> complaining... :)

I don't have much to add to Quincy's response--overriding 
-valueForUndefinedKey: is a good approach. I would say that there really isn't 
anything wrong with the controller knowing ahead of time what keys in the model 
will be needed by the UI. In fact, it needs to, and in fact does when you 
establish a binding. It is simply abstract enough that it is easy to forget ;-)

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to