* Source/NSKeyValueCoding.m ([-takeStoredValuesFromDictionary:]):

Implemented.
        * Headers/gnustep/base/NSKeyValueCoding.h: Ditto.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16012 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2003-02-19 14:42:07 +00:00
parent 690ce58ebe
commit e6e695d2b1
3 changed files with 26 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2003-02-19 David Ayers <d.ayers@inode.at>
* Source/NSKeyValueCoding.m ([-takeStoredValuesFromDictionary:]):
Implemented here instead of in GDL2.
* Headers/gnustep/base/NSKeyValueCoding.h: Ditto.
2003-02-18 Richard Frith-Macdonald <rfm@gnu.org>
* NSObject.m: ([+instancesRespondToSelector:]),([-respondsToSelector])

View file

@ -42,6 +42,7 @@
- (void) handleTakeValue: (id)anObject forUnboundKey: (NSString*)aKey;
- (id) storedValueForKey: (NSString*)aKey;
- (void) takeStoredValue: (id)anObject forKey: (NSString*)aKey;
- (void) takeStoredValuesFromDictionary: (NSDictionary*)aDictionary;
- (void) takeValue: (id)anObject forKey: (NSString*)aKey;
- (void) takeValue: (id)anObject forKeyPath: (NSString*)aKey;
- (void) takeValuesFromDictionary: (NSDictionary*)aDictionary;

View file

@ -220,6 +220,24 @@
}
}
- (void) takeStoredValuesFromDictionary: (NSDictionary*)aDictionary
{
NSEnumerator *enumerator = [aDictionary keyEnumerator];
NSNull *null = [NSNull null];
NSString *key;
while ((key = [enumerator nextObject]) != nil)
{
id obj = [aDictionary objectForKey: key];
if (obj == null)
{
obj = nil;
}
[self takeStoredValue: obj forKey: key];
}
}
- (void) takeValue: (id)anObject forKey: (NSString*)aKey
{
unsigned size;
@ -301,7 +319,7 @@
while ((key = [enumerator nextObject]) != nil)
{
id obj = [aDictionary objectForKey: key];
id obj = [aDictionary objectForKey: key];
if (obj == null)
{