【发布时间】:2011-02-09 05:50:53
【问题描述】:
我需要从应用程序的所有屏幕访问的常用功能:右栏按钮项和相关操作。
为了不重复代码,我想在自定义 UIViewController 中进行设置,并让我的所有视图控制器都继承自它。
- (void)viewDidLoad {
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(lightsCamera)];
self.navigationItem.rightBarButtonItem = rightBarButton;
}
- (void)lightsCamera {
…
}
不过,我有许多 UITableViewController,我想知道它们是否也可以继承这些功能?
【问题讨论】:
标签: iphone objective-c cocoa-touch uiviewcontroller uitableview