我正在使用 TTLauncherView,为此我将视图控制器声明为 TTViewController,就像在 TTCatalog 教程应用程序中一样。在该视图中声明一个 TTLauncherView 变量,添加项目,等等。
在我的应用程序的主视图中,有一个按钮使用以下代码调用上一个视图:
-(void) switchToButtonOrderingView
{
ButtonOrderingViewController *ButtonOrderingView=
[[ButtonOrderingViewController alloc] initWithNibName:@"ButtonOrderingViewController" bundle:nil];
self.ButtonOrderingViewController = ButtonOrderingView;
[self.view insertSubview:ButtonOrderingView.view atIndex:10];
}
当我按下按钮时,应用程序会以属于 TTViewController.m 的方法停止:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
UIViewController* popup = [self popupViewController]; //brakes up here
if (popup) {
return [popup shouldAutorotateToInterfaceOrientation:interfaceOrientation];
} else {
return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
}
错误是这样的:
[ButtonOrderingViewController popupViewController]:无法识别的选择器发送到实例
检查以查看 Three20 Class Hierarchy 和 TTViewController 是 UIViewController 子类。
popupViewController 是一个 TTPopViewController(及其子类)方法!我没有使用,TTCatalog 教程应用程序也没有使用。我迷路了。任何帮助将不胜感激。
谢谢。