Design Principles
Design Principles
- Subject: Design Principles
- From: Albion Baucom <email@hidden>
- Date: Fri, 23 Jul 2004 13:03:50 -0700 (PDT)
Im still very new to Cocoa/Objective-C programming and IB UI design, so
bare with me on these questions ...
I have a document based application that I have added a preferences panel
to. I want to "broadcast" those preferences alternately to either a single
open document (the "key" window), or to all currently open documents.
I am a little cornfused on how I should implement this.
I have subclassed NSDocuments that manage an NSWindow that has a
customview.
I have a Preferences NSObject that simply stores the preferences. I have a
PreferencesController NSWindowController that manages the actual
preferences UI panel and provides the outlets for the widgets.
PreferencesController is the File Owner in my Preferences NIB.
I want the preferences UI to talk to the customview in my subclassed
NSDocument.
Should the PreferencesController manage this? It seems as though it
should. That keeps the Preferences NSObject as generic as possible; all it
does is store and provide the actual preference values and does not need
to know about the views that are actually using the preferences. The
PreferencesController then manages the user input of new preferences and
the broadcast of the preference values to all the currently open
documents. It basically sits between, and links, the preferences values
and the documents.
If PreferencesController is indeed the corret way to implement these
actions, wow do I go about getting a handle on the customviews in the
PreferencesController so I can pass the preferences?
Using NSApp I can get an NSArray of NSWindows, but how do I then get from
there to the customview any of my subclasses NSDocuments currently opened
from an array of NSWindows?
I think I am making this more complicated than it should be, so maybe
someone can enlighten me.
Thanks!
Albion
Albion E. Baucom
http://rna.ucsc.edu/albion
_______________________________________________
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.