Re: Opposite of delegate?
Re: Opposite of delegate?
- Subject: Re: Opposite of delegate?
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 11 May 2001 18:13:56 -0700
On Friday, May 11, 2001, at 05:06 PM, Matt Ridley wrote:
Hi folks,
Within a class, I want to refer to the object which the class is the
delegate of. Sort of the opposite reference to "delegate". Is there a
convenient way to do so, or do I need to define and connect an outlet
for that?
First thing: the class isn't a delegate, an instance of the class can
be a delegate.
Second, there's no reason why the same object can't be the delegate of
any number of other objects. You may notice that most delegate methods
include a parameter for the object that's sending a delegate message,
whether explictly as in:
- (void)browser:(NSBrowser *)sender
createRowsForColumn:(int)column
inMatrix:(NSMatrix *)matrix
where "sender" is the object whose delegate you are,
or
- windowWillClose:(NSNotification *) notification
where the window in question can be obtained with [notification object];
-jcr
[Objc retain];