我正在开发iPhone应用程序。最初,我在同一个屏幕上使用了我的pickerview,因此这只是一个单页的应用程序。剥皮后,我意识到我想在它自己的单独页面上使用pickerview。所以我做到了。但是,我的pickerview最初会更新同一页面上的uilabels和其他对象。我怎样让我的pickerview从它的新视图中访问这些对象?UIPickerView单独页面
- (IBAction)ShowPickerAction:(id)sender {
if (self.theView == nil) {
theView = [containerView initWithNibName:@"containerView" bundle:nil];
theView.parentView = self;
}
self.theView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:self.theView animated:YES];
}
这是我使用打电话给我新的视图的方法。但是上面代码的第3行给出了错误“没有选择器initWithNibName:bundle的已知类名”。我认为这个错误与我在我的头文件中做错的事有关。我的新类叫做containerView。所以我做这在我的头:
@interface ViewController : UIViewController {
containerView *theView;
但是,这给我的错误“未知类型名containerView”即使我有一个名为containerView类!