Is there any way I can test if a method exists in Objective-C?
I\'m trying to add a guard to see if my object has the method before calling it.
There is also the static message instancesRespondToSelector:(SEL)selector You would call it like this:
[MyClass instancesRespondToSelector:@selector(someMethod:withParams:)]
or like this:
[[myObject class] instancesRespondToSelector:@selector(someMethod:withParams:)]
This may be useful if you would like to call one constructor or another one depending on this (I mean, before having the instance itself).