• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Writing nested dictionary fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Writing nested dictionary fails (From: Thomas Harrington <email@hidden>)

  • Prev by Date: Re: AppleScript little problem...
  • Next by Date: Re: More 10.1 backward compatibility: The solution
  • Previous by thread: Re: Writing nested dictionary fails
  • Next by thread: Size limit for NSData.
  • Index(es):
    • Date
    • Thread