Is it possible to check whether a subclass implements a method that exists either in its immediate superclass or in some superclass of its superclass, etc?
E.g. I subcla
Expanding on ZeMoon's answer, I found that there wasn't enough logic to satisfy all cases. I needed to add a check to ensure that instances of the next superclass in the loop implement the specified selector at all. Subclasses of UIView
are one example.
while (objSuperClass != Nil) {
isMethodOverridden = ([objSuperClass instancesRespondToSelector:selector]) &&
([object methodForSelector:selector] !=
[objSuperClass instanceMethodForSelector:selector]);
if (isMethodOverridden) {
}
}