gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key Value Observation is over reacting


From: Richard Frith-Macdonald
Subject: Re: Key Value Observation is over reacting
Date: Thu, 13 Dec 2007 18:17:16 +0000
User-agent: GNUMail (Version 1.2.0)

On 2007-12-13 17:34:34 +0000 Fred Kiefer <address@hidden> wrote:

While testing key value binding I found a problem with the current KVO
code. When an object is starting to get watched a new class gets cooked
up to handle the set calls on the object. Here all setter methods get
overridden, which is fine, as we don't want to change the class when
another key on the same object gets watched and this also allows to
reuse the new class for other objects.
But some of the replaced methods just don't are setters, even if the
look like. This later leads to a problem when the corresponding getter
is called and none exists. Here we should at least check, if a getter
exists and only then treat the method as a setter.
Is it OK, to change that code or is there something I overlooked?

I'm not sure ... while it does not sound unreasonable that every setter must have a corresponding getter, neither does it sound obviously true to me. I would suggest writing a testcase to determine what methods are overridden, and running it on MacOS-X before going any further ... best to try to make sure that our implementation has the same behavior as Apple's.

It may be that Apple check for the presence of a getter immediately before using it rather than at the point when the subclass is created.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]