Re: Delegates -- WHAT is delegated?
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