Re: Writing nested dictionary fails
Re: Writing nested dictionary fails
- Subject: Re: Writing nested dictionary fails
- From: Thomas Harrington <email@hidden>
- Date: Mon, 16 Dec 2002 19:37:48 -0700
On Monday, December 16, 2002, at 06:01 PM, Mike Ferris wrote:
The font attributes are presumably going to include an NSFont
object... NSFont is not a plist-able object. NSDictionary's
writeToFile:atomically: writes property lists only, it is not a
general archiving mechanism. And the attributes used by NSTextStorage
are often not plist objects.
D'oh! You are, of course, correct. I misread the description as
meaning that "NSFont" was a key name.
One possible solution for you would be to archive the attribute
dictionary (the standard Cocoa attribute values all conform to
NSCoding). Then you can put the resulting NSData in your dictionary.
Sketch actually does this for the whole NSTextStorage objects that it
uses in its TextArea object to store the contents if you want an
example...
That sounds like the best idea. Thanks a lot.
--
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.