In Objective-C I know you can forward selectors from one instance to another:
- (id)forwardingTargetForSelector:(SEL)aSelector;
How can I also forward class methods to another class? resolveClassMethod:
didn't seem appropriate, because I don't want to dynamically add methods to my class, just forward the calls.
Edit: So far the best I have is to create an instance that forwards its selector to a class object, like this:
- (id)forwardingTargetForSelector:(SEL)aSelector
{
return NSClassFromString(@"TheClass");
}
Its just a little uglier, because the proxy object has to accept instance methods, so the proxy has to declare instance methods for the class methods it is proxying.