我有一个应用程序,它是表格视图中的项目列表,并为表格视图上的每个项目显示详细视图控制器。它还将 MMDrawerController(根视图控制器)实现为带有故事板的侧菜单。我正在深度链接我的应用程序并使用来自 App Delegate 的应用程序开放 URL 源应用程序注释方法来处理它。所以,我想使用 MMDrawerController 从这个方法推送一个细节视图控制器,我遇到了一些麻烦。看看一些代码:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DetalheRestauranteViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"detalheRest"];
MMDrawerController* drawerController = (MMDrawerController *)self.window.rootViewController;
// If I use this nothing happens
[drawerController.centerViewController.navigationController pushViewController:vc animated:YES];
// If I use this nothing happens
[((MMDrawerController *)self.window.rootViewController).centerViewController.navigationController pushViewController:vc animated:YES];
// If I use this I got the unrecognized selector error
[(UINavigationController*)self.window.rootViewController pushViewController:vc animated:NO];
return YES;
}
有人可以帮我弄这个吗?