I have an object (A) that needs to work as a proxy to an other object. there is also a condition that when verified should make the object work as nil.
I've implemented:
-(void)forwardInvocation:(NSInvocation *)anInvocation
{
if (condition)
[anInvocation invokeWithTarget:self.object];
else
[anInvocation invokeWithTarget:nil];
}
but it's not enough. when the condition is satisfied and a method is called on A unrecognized selector sent to instance
is raised.