[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: KVC triggers Key-value access using _setKey: is deprecated
From: |
Richard Frith-Macdonald |
Subject: |
Re: KVC triggers Key-value access using _setKey: is deprecated |
Date: |
Sun, 6 Jun 2010 05:52:33 +0100 |
On 5 Jun 2010, at 22:34, David Wetzel wrote:
> Hi Folks,
>
> - (void)setValue:(id)value forKeyPath:(NSString *)keyPath
>
> triggers
>
> GSOnceFLog(@"Key-value access using _setKey: is deprecated:");
>
> on GNUstep base.
> setValue: forKeyPath: is not depricated, so base must be wrong somewhere...
Take a look at
http://developer.apple.com/mac/library/documentation/cocoa/conceptual/KeyValueCoding/Concepts/SearchImplementation.html
Near the end of that page I see this:
For backward binary compatibility with the behavior of takeValue:forKey:, a
method whose name matches the pattern -_set<Key>: is also recognized in step 1.
KVC accessor methods whose names start with underscores are deprecated as of
Mac OS X v10.3.
My reading of this is that firstly, calling 'setValue:forKeyPath:' will call
_setKey: as a last resort for backward compatibility, and secondly, _setKey: is
deprectated. Which seems to fit the behavior you are seeing.