:)
I was not even at this level. Many people confuses delegation and
forwarding. I remember that I helped removing some errors in books I
reviewed.
Stef
On 16/7/14 20:07, Eliot Miranda wrote:
On Wed, Jul 16, 2014 at 1:48 AM, stepharo <[email protected]
<mailto:[email protected]>> wrote:
Hi
In the quest for a better UI framework :), I was re rereading
about delegate in Cocoa.
A delegating object will delegate certain operations to a delegate
object (check the attachment).
Now I was wondering why this is not a simple delegation they wrote:
The delegating object sends a message only if the delegate
implements the method. It makes this discovery by invoking the
NSObject method respondsToSelector: in the delegate first.
Sad that this framework confuses delegation and forwarding. What it
describes as delegation is merely forwarding. Delegation is quite
different; self is bound to the delegator when running delegated
methods. When (as in Self) one object delegates to another, sends to
self in the second object bind to methods in the first object, the
delegator. In forwarding, self is bound to the object the message is
forwarded to (i.e. normal Smalltalk & ObjectiveC semantics).
--
best,
Eliot