Re: KVO problems popping up in Leopard
Re: KVO problems popping up in Leopard
- Subject: Re: KVO problems popping up in Leopard
- From: "Doug Knowles" <email@hidden>
- Date: Mon, 19 Nov 2007 08:12:29 -0500
On Nov 19, 2007 2:10 AM, David Spooner <email@hidden> 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!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden