Re: Simple Interface Connection Question
Re: Simple Interface Connection Question
- Subject: Re: Simple Interface Connection Question
- From: Uli Kusterer <email@hidden>
- Date: Wed, 25 Apr 2007 10:34:08 +0200
Am 25.04.2007 um 02:56 schrieb Keary Suska:
One common approach I like to call the "proxy" approach. That is, the
connection is "proxied" through the file's owner. In this approach,
one of
the file's owner objects will maintain a reference to either the
other nib's
file's owner, or the object that owns the file's owner. As long as
an object
has a path to any object, it can send messages to that object. What
makes
this work for outlets is that most, if not all, outlets can be set
using an
accessor method. Problem solved.
Another, usually conceptually cleaner approach is to take advantage
of the responder chain. E.g. if you want a menu item in your
MainMenu.nib to point at an action used by a window in another NIB,
just connect it to the "first responder" icon and implement it in
your window controller for that window in the other NIB. When the
responder chain is searched during menu updating, it will then find
that window if it's open and enable the menu item appropriately. Very
simple once one gets one's head around it, and very powerful. Not to
mention many windows can share the same menu item to do the same
thing in the way that's most appropriate for them.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden