I am creating a subclass of UIBarButtonItem to provide some specific functions.
The new class has an initializer, which is the only one that should be used when instantiating the class:
- (id) initWithSomeObject:(SomeObject *)param;
The problem is that all initializers from the UIBarButtonItem are still available, so I can instantiate my new class using something like
MyCustomUIBarButtonItem *button = [[MyCustomUIBarButtonItem alloc] initWithBarButtonSystemItem:systemItem target:target action:action];
or something else...
Is there a way to hide initializers from UIBarButtomItem in my subclass so that they cannot be used?
source
share