FROM : Doug Knowles
DATE : Mon Nov 19 14:12:29 2007
On Nov 19, 2007 2:10 AM, David Spooner <<email_removed>> wrote:
> Do your proxy objects shadow the attributes of the model objects (say in a
> dictionary), or does -valueForUndefinedKey: simply return [model
> valueForKey:]? If the latter, do your proxy objects observe the attributes
> of the model and invoke will/did change methods from their observation
> method or are will/did invoked directly from -setValue:forUndefinedKey:?
>
I've been invoking the will/did change methods from the observe... method
for the model object keys.
>
> It might be worth considering the shadowing approach. Here your proxy
> would maintain a dictionary of the relevant model properties; it would
> observe those model properties and update its dictionary accordingly; its
> -valueForUndefinedKey: would return a value from the dictionary; and its
> -setValue:forUndefinedKey: would simply invoke the model's setValue:forKey:.
> This approach avoids the need to explicitly invoke the will/did change
> methods...
>
For the property in question, I implemented getter/setter methods in the
proxy since I started encountering this problem; these methods provided no
backing store for the property, so I've been returning NO from +
accessInstanceVariablesDirectly. Your suggestion to maintain a dictionary
is a more general solution for the other (dynamically generated properties)
my proxy; I'll try that today.
Thanks again for your time and assistance!
DATE : Mon Nov 19 14:12:29 2007
On Nov 19, 2007 2:10 AM, David Spooner <<email_removed>> wrote:
> Do your proxy objects shadow the attributes of the model objects (say in a
> dictionary), or does -valueForUndefinedKey: simply return [model
> valueForKey:]? If the latter, do your proxy objects observe the attributes
> of the model and invoke will/did change methods from their observation
> method or are will/did invoked directly from -setValue:forUndefinedKey:?
>
I've been invoking the will/did change methods from the observe... method
for the model object keys.
>
> It might be worth considering the shadowing approach. Here your proxy
> would maintain a dictionary of the relevant model properties; it would
> observe those model properties and update its dictionary accordingly; its
> -valueForUndefinedKey: would return a value from the dictionary; and its
> -setValue:forUndefinedKey: would simply invoke the model's setValue:forKey:.
> This approach avoids the need to explicitly invoke the will/did change
> methods...
>
For the property in question, I implemented getter/setter methods in the
proxy since I started encountering this problem; these methods provided no
backing store for the property, so I've been returning NO from +
accessInstanceVariablesDirectly. Your suggestion to maintain a dictionary
is a more general solution for the other (dynamically generated properties)
my proxy; I'll try that today.
Thanks again for your time and assistance!
| Related mails | Author | Date |
|---|---|---|
| Doug Knowles | Nov 15, 04:01 | |
| David Spooner | Nov 15, 08:19 | |
| Doug Knowles | Nov 19, 01:37 | |
| David Spooner | Nov 19, 08:10 | |
| Doug Knowles | Nov 19, 14:12 |






Cocoa mail archive

