In <210720030631331455%nonenone.com> None wrote:
> Hello,
>
> Could I get some advice or recommendations on how best to organize the
> nib files and classes for a program I'm writing? There will be about
> 10 or so different types of data, each with its own doent type.
> Each data type will have its own window types that can display the
> data in different ways. A user might only use one or two data types
> for any particular session, so I will use different nibs loaded as
> needed for each type. I guess each doent type should have its own
> doent subclass and nib file. Would it be reasonable to also store
> the sub-classed doent controller in the same nib? (If so, who gets
> to be the file owner, the doent subclass or the doent controller
> subclass?)
Use the existing doent framework. Let the AppKit do the work. You
don't need to store doents or doent controllers in any nib. Your
NSDoentController will be instantiated automatically and it will take
care of creating NSDoent instances. It is not usually necessary to
subclass NSDoentController.
> Next, for the windows, is it more standard to create a new nib file
> for each window type, or could one have multiple window types in the
> same doent subclass nib as the relevant data type? If so, how do I
> refer the the window controller in there, without it being the file
> owner?
One window, one window-controller (an NSWindowController subclass), one
nib, with the NSWindowController as the file's owner. It is almost
always right to use the form of NSDoent where you override
makeWindowControllers. Read ...Doents/Tasks/FAQ.html, on your hard
drive. m.


--
matt neuburg, phd = [email]matttidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.