We can easily check if object has a method by using respondsToSelector:, but how we do it for static functions in class?
I would like to have something like this:
if ([cls classRespondsToSelector:@selector(staticMethodName)]) {
...
}
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.
In Objective-C classes are objects too.
Also a small note, these are NOT ‘static’ methods. That means something specific which doesn’t exist in Objective-C. They are class methods.