【问题标题】:Pushing ViewController from side menu not working从侧面菜单推送 ViewController 不起作用
【发布时间】:2013-11-10 11:24:07
【问题描述】:

我正在编写一个侧面菜单,就像 Facebook 应用程序中的联系人菜单一样。我希望当用户选择一个联系人时,菜单关闭并且 TopViewController 推送聊天。问题是使用下面的代码,它只会关闭菜单。

 "Menu.m"

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
    UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"chat"];
    [self.slidingViewController.topViewController.navigationController pushViewController:controller animated:YES];

    [self.slidingViewController resetTopView];
}

【问题讨论】:

  • 您应该记录您的一些实体(self.slidingViewController、self.slidingViewController.topViewController 和 self.slidingViewController.topViewController.navigationController)以查看是否有任何实体。
  • 我会做的,我会告诉你一些事情。
  • 我明白了:Self.slidingViewController.topviewcontroller.navigationcontroller: (null)。但我不明白为什么,因为如果我在 TopViewController 中调用此方法,它会起作用。
  • 你知道为什么它是空的吗? @rdelmar
  • 不,不是没有看到你的应用程序的结构。

标签: ios uiviewcontroller menu uinavigationcontroller pushviewcontroller


【解决方案1】:

这些是您想要归档 side menufacebook style slide menu 的好教程

【讨论】:

  • 这不是我要求的。我想在导航控制器中推送一个视图控制器。两者都只是推动一个视图控制器。
猜你喜欢
  • 2013-11-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多