I have a common functionality with which I need to access from all screens of my application: the right button element and the action associated with it.
In order not to repeat the code, I would like to install it in a custom UIViewController and inherit all of my controllers from it.
- (void)viewDidLoad { UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(lightsCamera)]; self.navigationItem.rightBarButtonItem = rightBarButton; } - (void)lightsCamera { … }
However, I have several UITableViewControllers, and I would like to know if it is also possible to inherit functionality from them?
objective-c iphone cocoa-touch uitableview uiviewcontroller
prendio2
source share