I need to find out if some particular object has some particular selector AND if i may call it. I need to check it at runtime. I know about respondsToSelector:
but unfortunaly it also checks protected interface of class.
I need to check if the selector exists AND if it's public. Is there a way i can do it?
In Objective-C there is no concept of public, private or protected methods. Only IDE can incorporate those concepts to provide some OOP when developing but at runtime everything goes, so there is no standard way to do this.
What you could do is to subclass (or make a category with associated objects) NSObject, create array with public methods selectors where every next subclass adds its public methods to this array and either use your own method or swizzle respondsToSelector method to check for match in your array.