I’m developing a library to IOS, which at some point need to create a NSArray of methods reference´s from various classes. To an single class that will at some point call them.
Any ideas how to do that??
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have some options. You can use
NSStringsto actually have the name of your methods and then just do:You can then add your selector to your
NSArray.You can also use
NSInvocationsand store the methods and define the target later:From Apple Documentation.
Edit 1 (for the fun of it):