• 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: Delegates -- WHAT is delegated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delegates -- WHAT is delegated?


  • Subject: Re: Delegates -- WHAT is delegated?
  • From: Klaus Backert <email@hidden>
  • Date: Thu, 21 Dec 2006 01:28:05 +0100


Am 20.12.2006 um 22:14 schrieb Sam Colombo: <snip>
So the bottom line is that there is no sure way to identify what is
delegatable from the supplied headers themselves. You have to depend on the
occasional comments, protocols with "delegate" in their title, and
Notifications (or just look in the documentation) and take it on faith that
they are actually delegatable. I guess I can live with that. (Like I have a
choice. :-)
<snip>

If I understand it correctly, the method passed to the delegate is *not necessarily* supplied by the header of the class, which is delegating (but in many cases it is).

E.g. the class NSMatrix has a method textShouldBeginEditing:, which sends control:textShouldBeginEditing: to the delegate of the NSMatrix by default. This delegate could be any class (e.g. a subclass of NSWindowController). The method control:textShouldBeginEditing: is defined in the header of this class, but not in the header of NSMatrix. The names of the methods don't have to be similar, of course.

Generally it's not necessary, that the delegated method is implemented in the delegating class at all, I think.

Cheers
Klaus
_______________________________________________

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


  • Follow-Ups:
    • Re: Delegates -- WHAT is delegated?
      • From: mmalc crawford <email@hidden>
References: 
 >Re: Cocoa-dev Digest, Vol 3, Issue 1474 (From: Sam Colombo <email@hidden>)

  • Prev by Date: Re: Delegates -- WHAT is delegated?
  • Next by Date: Re: Using NSAlert sheets
  • Previous by thread: Re: Delegates -- WHAT is delegated?
  • Next by thread: Re: Delegates -- WHAT is delegated?
  • Index(es):
    • Date
    • Thread