Writing nested dictionary fails
Writing nested dictionary fails
- Subject: Writing nested dictionary fails
- From: Thomas Harrington <email@hidden>
- Date: Mon, 16 Dec 2002 17:38:21 -0700
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.