On Tue, Nov 18, 2008 at 5:43 PM, Jean-Nicolas Jolivet
<[EMAIL PROTECTED]> wrote:
> I have a custom window controller (let's call it CustomWindowController) to
> manage a custom window... this is contained in a separate nib file (i.e. not
> in my MainMenu.nib)

Typically this isn't what you want to do.  You'll usually create the
window controller from code (external to any nib) and use it as the
owner of a nib that contains the window you want it to control.

> In that window's nib file, the File Owner is set to that
> CustomWindowController class so that my class can communicate with my
> window...

Good.

> Now here comes the tricky part: I want a menu item from the app's main menu
> (located in MainMenu.nib) to ALSO be able to perform this action (the same
> performActionClicked:  thats located in my CustomWindowController)....

Use the responder chain.

> Is there a way that both nib files can "share" the same instance of my
> CustomWindowController???

If you can reach it from File's Owner, you can do what you want, but
as I said above this is a typical use of the responder chain.  Though
depending on your situation an NSWindowController subclass might not
be the appropriate place for it; it might be an NSDocument subclass or
your NSApplication's delegate.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to