Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(Newbie) How do Multiple NSWindowControllers find MyDocument?



My app will have a "master" window with push buttons to open (as needed)
different views on my data.

I understand the multiple nib - multiple window controller arrangement with
override of makeWindowControlers tolerably well (I think).  But..

If I understand "Document-Based Applications Overview" correctly,
MyDocument should handle the data, and should add the new window
controllers as needed, as well as providing the interface to the data.

So, if the button is pushed to bring up a new window, the IBAction is in
the master window controller.  But the actual adding of the
NSWindowController and its associated window should be done by a method
back in MyDocument.

I can't find description of this part of the process.  One way I can think
of to do it is as follows:

In my MasterWindowController, have an instance variable called something
like "createdby", and a method "setCreatedby".  Then in MyDocument, when I
alloc and init the instance of the masterWindowController, I follow
directly with [masterWindowController setCreatedby:self].

Or, is there a more Cocoa-ish way of doing this?

Thanks,

John Velman
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.