[Top][All Lists]

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

Re: Fix, Base, NSKeyValueCoding (SetValueForKey())

From: Richard Frith-Macdonald
Subject: Re: Fix, Base, NSKeyValueCoding (SetValueForKey())
Date: Tue, 23 Jun 2009 07:09:24 +0100

On 23 Jun 2009, at 04:54, Georg Fleischmann wrote:


here is a fix for NSKeyValueCoding SetValueForKey() to prefer the key as is (without leading underscore) before trying with underscore (_key).

My problem: When loading a Nib file with a key named "infoPanel" for NSApplication, the value gets set to "_infoPanel" instead, which also exists in GNUstep.

I'm afraid your 'fix' is actually a request to introduce a bug. The order in which things are searched for is well defined (see http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/SearchImplementation.html) and the GNUstep implementation needs to stick to that ordering. I happen to think that the fact that KVC uses names with leading underscores is a design error by Apple, but it's the way things are.

It seems to me that the problem is the choice of key or the choice of ivar name, and any fix should be made at one of those rather than changing the KVC mechanism.

reply via email to

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