OK, I am a little confused.
I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling \"table view\" like UI element. UIScrollView itself s
[super respondsToSelector:@selector(frobnosticate:)]
doesn't do what you think.
It goes to the superclass, gets the implementation of respondsToSelector:
there, and then runs it on the current object. In other words, super
represents the same object as self
, it just starts the method lookup one step higher in the inheritance tree.
So you're running respondsToSelector:
on this subclass, which replies "YES", but then later trying to get gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
from the superclass, which doesn't have it.
To check instances of the immediate superclass, you would use instancesRespondToSelector:
, as jjburka recommend, but I would suggest [self superclass]
as the subject of that, like so:
[[self superclass] instancesRespondToSelector:@selector(gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:)];
which avoids hardcoding class names.