Re: Delegates -- WHAT is delegated?
Re: Delegates -- WHAT is delegated?
- Subject: Re: Delegates -- WHAT is delegated?
- From: leenoori <email@hidden>
- Date: Sat, 23 Dec 2006 17:17:39 +0100
El 23/12/2006, a las 16:38, William Squires escribió:
Cocoa objects that support delegates tend to implement delegation
to mean "When certain events happen, check to see if the delegate
implements a specific method selector. If it does, perform that
selector on the delegate object to give it a chance to respond to
the event".
This sounds like a more complicated version of RB's event model,
wherein you can make a "New Event" in a class so that subclasses
will get that event (if they want to code it), or ignore it (by
putting no code in it) in which case it'll be available to any
subclass of that subclass. Is this similar?
No because the whole point of delegates is that they enable you to
customize (or influence, or override) the behaviour of an object
without having to write a subclass. Any object at all can be a delegate.
Of course, Objective-C also offers the possibility of subclassing,
but for many things delegates work out to be simpler and/or better.
_______________________________________________
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