• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opposite of delegate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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];


References: 
 >Opposite of delegate? (From: Matt Ridley <email@hidden>)

  • Prev by Date: Re: Opposite of delegate?
  • Next by Date: Re: Drawer-related problem
  • Previous by thread: Re: Opposite of delegate?
  • Next by thread: Drawer-related problem
  • Index(es):
    • Date
    • Thread