Re: Writing nested dictionary fails
Re: Writing nested dictionary fails
- Subject: Re: Writing nested dictionary fails
- From: Andrew Pinski <email@hidden>
- Date: Mon, 16 Dec 2002 22:51:15 -0800
It is not you cannot write out nested dictionaries but you not write
out a dictionary from [str fontAttributesInRange:NSMakeRange(0,0)].
Thanks,
Andrew Pinski
On Monday, Dec 16, 2002, at 16:38 US/Pacific, Thomas Harrington wrote:
I have a situation where an NSDictionary which contains another
NSDictionary fails to writeToFile:atomically, though the file
destination is valid. Basically this:
NSAttributedString *str; // Initialized elsewhere
NSDictionary *foo = [str fontAttributesInRange:NSMakeRange(0,0)];
NSMutableDictionary *bar = [NSMutableDictionary dictionary];
[bar setObject:foo forKey:@"dictKey"];
[bar setObject:@"tph" forKey:@"user"];
[bar writeToFile:@"/tmp/test" atomically:YES];
The writeToFile fails. But if I comment out the line that adds the
nested dictionary, writeToFile succeeds. Why can't I write this
nested dictionary to a file? Printing out its description works fine,
so I know the structure's as I expect it, but I can't get it on disk.
--
Tom Harrington
email@hidden
_______________________________________________
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.
_______________________________________________
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.