objective c - How can I invoke a class method by NSInvocation? -
we can nsmethodsignature + (nsmethodsignature *)instancemethodsignatureforselector:(sel)aselector of nsobject. construct nsinvocation + (nsinvocation *)invocationwithmethodsignature:(nsmethodsignature *)signature
here problem. can method signature of instance,how class method?
you can class methods by:
nsmethodsignature *pms = [[yourobject class] methodsignatureforselector: (sel)aselector]; the fragment [yourobject class] returns instance of class object (singleton) can use class methods.
add: new info comments below. can following:
nsmethodsignature *pms = [yourobject methodsignatureforselector: (sel)aselector];
Comments
Post a Comment