I want to know if a superclass implements class A from my subclass, which also implements method A, so I can safely call [super A] from my subclass without getting an exception.
NSObject responds with SoSelector: in this case it does not work, since it will always return true (because my subclass implements this method). Any ideas?
To do this, you can use the class method instancesRespondToSelector:. Therefore, from a subclass, you can call [[self superclass] instancesRespondToSelector:@selector(...)]to determine if the superclass implements the class that you need.
instancesRespondToSelector:
[[self superclass] instancesRespondToSelector:@selector(...)]
[[self superclass] instancesRespondToSelector:@selector(...)] , , , . , :
[[ExplicitClassName superclass] instancesRespondToSelector:@selector(...)]
Try [[[self class] superclass] instances ofRespondToSelector: @selector (.)]]]
[super responds to SoSelector:] calls the implementation of the responseToSelector superclass, which most likely matches the current class. It does not check if a superclass implements a class.