Re: write dictionary to file
Re: write dictionary to file
- Subject: Re: write dictionary to file
- From: Esteban Uribe <email@hidden>
- Date: Tue, 08 Apr 2003 16:34:12 -0700
Hi,
On Tuesday, April 08, 2003, at 01:35PM, Gerriet M. Denkmann <email@hidden> wrote:
>
When I run this small program:
>
>
id key = [ NSNumber numberWithInt: 42 ] ;
>
id value = @"the meaning of life" ;
>
id totalKnowledge = [ NSDictionary dictionaryWithObjectsAndKeys: value,
>
key, nil ] ;
>
if ( ![ totalKnowledge writeToFile: @"/tmp/abc.plist" atomically: YES ]
>
)
>
NSLog(@"confused");
>
>
I always get "confused".
>
I read the docs over and over again, but do not see anything wrong.
>
Is this a bug, or have I missed something?
>
>
Btw: it work of course with key = @"42".
I think the problem is that writeToFile only writes out keys that are NSStrings.
This same limitation does not apply to the object referred to by the key which
can be NSData, NSDate, NSNumber, NSString, NSArray, or NSDictionary objects.
-Esteban
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.