proxy - How can I forward class methods in Objective-C? -
in objective-c know can forward selectors 1 instance another:
- (id)forwardingtargetforselector:(sel)aselector;
how can forward class methods class? resolveclassmethod:
didn't seem appropriate, because don't want dynamically add methods class, forward calls.
edit: far best have create instance forwards selector class object, this:
- (id)forwardingtargetforselector:(sel)aselector { return nsclassfromstring(@"theclass"); }
its little uglier, because proxy object has accept instance methods, proxy has declare instance methods class methods proxying.
in objective-c class object object other , support forwarding in same way. looking is:
+ (id)forwardingtargetforselector:(sel)aselector
Comments
Post a Comment