From e3b3ecf55deb98ba9dbd29a067ea8f3e77efc6c9 Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 13 May 1996 16:39:21 +0000 Subject: [PATCH] ([NSDictionary -description]): Implemented by Nathan Urban. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1533 72102866-910b-0410-8b05-ffd578937521 --- Source/NSDictionary.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index be9d11402..74b6482ac 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -179,8 +179,20 @@ static Class NSMutableDictionary_concrete_class; - (NSString*) description { - [self notImplemented:_cmd]; - return 0; + id desc; + id keyenum = [self keyEnumerator]; + id key; + int i; + desc = [NSMutableString stringWithCapacity:2]; + [desc appendString:@"{"]; + while(key = [keyenum nextObject]) { /* I wish appendString: returned self*/ + [desc appendString:[key description]]; + [desc appendString:@" = "]; + [desc appendString:[[self objectForKey:key] description]]; + [desc appendString:@"; "]; + } + [desc appendString:@"}"]; + return desc; } - (NSString*) descriptionWithIndent: (unsigned)level