Protected methods in Objective-C
You can simulate protected and private access to methods by doing the following:
- Declare your private methods in a class extension (i.e. a unnamed category declared near the top of the class' .m file)
- Declare your protected methods in a Subclass header – Apple uses this pattern with respect to UIGestureRecognizer (see documentation and reference to UIGestureRecognizerSubclass.h)
These protections are not, as Sachin noted, enforced at runtime (as they are in Java, for example).
You can neither declare a method protected or private. Objective-C's dynamic nature makes it impossible to implement access controls for methods. (You could do it by heavily modifying the compiler or runtime, at a severe speed penalty, but for obvious reasons this is not done.)
Taken from Source.