Per-document preferences?
Per-document preferences?
- Subject: Per-document preferences?
- From: James Bucanek <email@hidden>
- Date: Fri, 24 Jun 2005 15:22:54 -0700
I keep thinking this should be easy...
I'm ready to add preferences and persistent layout support to my Cocoa application.
I need to save the following in each document:
- The position and layout of the window (several table and outline views, column ordering and widths, sorting order, split pane positions, toolbar layout, etc.)
- Several per-document user settings
I thought this would be done with NSUserDefaults and the "autosave" feature of NSTableView and the like. But NSUserDefaults doesn't appear to extend to documents, and "autosave" seems to only work on a per-application basis.
So I'm left wondering how to do this. I assume I have to create my own dictionary of document settings, read and save each and every display dimension out of my window, then turn the whole mess into an XML document that I can store in document file. When opening a document, I do the whole bloody thing in reverse.
Is there a better way?
--
James Bucanek <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden