gnustep-dev
[Top][All Lists]
Advanced

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

Re: RFA: [base] NSKeyValueCoding fix ivar search order


From: David Ayers
Subject: Re: RFA: [base] NSKeyValueCoding fix ivar search order
Date: Thu, 27 Mar 2003 09:56:05 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210

Richard Frith-Macdonald wrote:


On Tuesday, March 25, 2003, at 11:24  pm, David Ayers wrote:

Hello Richard,

Setting up the (still uncommited) tests for GDL2 I noticed that the search order for ivars differs from what WO4.5 does. I take it that OS X takeValue:forKey: should first check the actual key as an ivar before it checks _key.

      * Source/NSKeyValueCoding.m ([NSObject -takeValue:forKey:]):
      Corrected search order of instance variables.


The documentation says .., 'sets the value directly. For the key "lastName" this would be _lastName or lastName." which to me implies that it tries the version with the underscore first. However, a test program under MacOS-X shows that in fact it tries the version without the underscore first.

Anyway, the change in the patch would seem to implement MacOS-X behavior, whatever the documentation may say. It might be a good idea to add an autogsdoc comment to clarify this (ie document the order explicitly).

       * Source/NSKeyValueCoding.m: Added documentation.
       * Source/NSKeyValueCoding.m ([NSObject -takeValue:forKey:]),
       ([NSObject -valueForKey:]): Corrected search order of instance
       variables.


Commited

Cheers,
Dave







reply via email to

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