Fix for MacOS-X compatibility accessing ivars directly

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26312 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-03-16 07:34:25 +00:00
parent 6e89e23210
commit 3ccc51710e
2 changed files with 4 additions and 2 deletions

View file

@ -3,6 +3,8 @@
* Source/NSArray.m:
* Source/NSSet.m:
Add ([-valueForKeyPath:]) to implement KVC aggregate operators.
* Source/NSKeyValueCoding.m: When accessing instance variable directly
look for _var before var as in MacOS-X
2008-03-14 Nicola Pero <nicola.pero@meta-innovation.com>

View file

@ -206,10 +206,10 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
{
buf[4] = lo;
buf[3] = '_';
name = &buf[4]; // key
name = &buf[3]; // _key
if (GSObjCFindVariable(self, name, &type, &size, &off) == NO)
{
name = &buf[3]; // _key
name = &buf[4]; // key
GSObjCFindVariable(self, name, &type, &size, &off);
}
}