• 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
Writing nested dictionary fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Writing nested dictionary fails
      • From: Andrew Pinski <email@hidden>
    • Re: Writing nested dictionary fails
      • From: Mike Ferris <email@hidden>
  • Prev by Date: Re: Finding Preference International Languages
  • Next by Date: Re: NSTextView headers and footers?
  • Previous by thread: Specific table column causes problems in NSTableViews
  • Next by thread: Re: Writing nested dictionary fails
  • Index(es):
    • Date
    • Thread