pre*_*io2 6 iphone cocoa-touch objective-c uitableview uiviewcontroller
我有我需要从我的应用程序的所有屏幕访问的常用功能:右键栏项和相关操作.
为了不重复代码,我想在自定义的UIViewController中设置它并让我的所有视图控制器继承它.
- (void)viewDidLoad {
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(lightsCamera)];
self.navigationItem.rightBarButtonItem = rightBarButton;
}
- (void)lightsCamera {
…
}
Run Code Online (Sandbox Code Playgroud)
但是,我有许多UITableViewControllers,我想知道他们是否有可能继承这些功能?