From 5c5bd427dc6574abfda184c2cef8542d1af8b84a Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 6 Jan 1997 22:43:08 +0000 Subject: [PATCH] ([NSDictionary -initWithContentsOfFile:]): Implemented. (By David Wetzel .) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2022 72102866-910b-0410-8b05-ffd578937521 --- Source/NSDictionary.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 71974b77c..e91f4a2fb 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -1,5 +1,5 @@ /* NSDictionary - Dictionary object to store key/value pairs - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by: Andrew Kachites McCallum From skeleton by: Adam Fedor @@ -181,8 +181,16 @@ static Class NSMutableDictionary_concrete_class; - initWithContentsOfFile: (NSString*)path { - [self notImplemented:_cmd]; - return 0; + NSString *myString; + + myString = [[NSString alloc] initWithContentsOfFile:path]; + if (myString) + { + [self initWithDictionary: (NSDictionary*) [myString propertyList]]; + return self; + } + [self autorelease]; + return nil; } - (unsigned) count