I\'m trying to transform one method call into another dynamically (at runtime).
For instance, I\'d like the following:
[obj foo]
t
You can use the method -forwardInvocation:
for that. It takes a full NSInvocation
object which represents the method call, and you can handle it however you wish. If you do this, you should also override -methodSignatureForSelector:
to return the correct NSMethodSignature
(required for -forwardInvocation:
to work on unknown selectors). It's also recommended that you override -respondsToSelector:
to declare that you can handle the selector in question.