Re: double forwarding problem
Re: double forwarding problem
- Subject: Re: double forwarding problem
- From: Jakob Olesen <email@hidden>
- Date: Sat, 4 Nov 2006 18:18:00 +0100
On 04/11/2006, at 1.07, Ivan Kourtev wrote:
The problem is that methodSignatureForSelector is sent before
forwardInvocation so I don't have a chance to simply change the
invocation target. At this point, the only thing that comes to
mind is to change the implementation of - [B
methodSignatureForSelector] to check whether B responds to the
selector (as in the example at the end). But then what do I return
if I find out that respondsToSelector is YES? I can't return [self
methodSignatureForselector:selector] because it will start calling
itself recursively.
This is the right thing to do, and you can call [super
methodSignatureForselector:selector] to get the original (NSObject)
implementation.
Is this kind of double forwarding a bad idea in principle or am I
missing some [hopefully more elegant] way to resolve this?
It is a quite complicated thing to do, but certainly possible. You
don't say which problem you are trying to solve, so it is difficult
to give you advise about better solutions.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden