I would like to invoke a selector from a method containing a vargs parameter list. Is there a way to dynamically provide a variable of number of parameters to a selector?
Share
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.
Unfortunately when using
performSelector, your only option for passing multiple parameters is to pass in a NSArray or NSDictionary, etc. Obviously you then have to change the receiving method’s constructor to accept that new parameter-storing object.Alternatively, you could look into using NSInvocation.