I’m working with a static class that only delegate methods to an instance of another class. It’s a kind of wrapper for Core Data context :
implementation CoreDataUtil
static NSManagedObjectContext* context;
+ saveContext {
[context saveContext];
}
... (several static methods)
@end
I’m not very happy with this approach. So I re-designed all differently.
For legacy considerations (old calls to CoreDataUtil class methods), I would like to keep the CoreData class. I would like it to “redirect” undefined methods to another instance.
I know it can be done for instance method with the ‘forwardingTargetForSelector’. But I would like the same mecanism for class method (that redirects to instance methods).
Thanks.
I had a similar problem myself and tried a lot of things, including the ones described in my question here: forwardInvocation to other class instead of instance
After all, unfortunately it doesn’t seem possible to catch method calls on the “static”, i. e. class method, level.