Re: Per-document preferences?
Re: Per-document preferences?
- Subject: Re: Per-document preferences?
- From: SA Dev <email@hidden>
- Date: Fri, 24 Jun 2005 19:01:00 -0400
Why don't you just create an NSMutableDictionary as an iVar for
your document? Save it along with all the rest of your doc data.
On Jun 24, 2005, at 6:22 PM, James Bucanek wrote:
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:
40silentalcove.net
This email sent to 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