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

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -