- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
iOS7、Xcode 和 5 一切都很好 - 升级到 Xcode 6 和 iOS8 后,应用程序突然崩溃,而它一直工作正常。
崩溃时显示的错误是:
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'adding a root view controller as a child of view controller:'
我设法找到了造成问题的单行:
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:4] animated:YES];
该应用程序在练习时最多可添加 8 个 View ;当练习完成后,只需返回到最后一个 View ,即练习的菜单,因此 4。有点硬编码,但简单高效,因为总是如此。
我不知道 popToViewController 正在这样做。
任何帮助或想法将不胜感激。
最佳答案
我终于找到了一个有效的解决方案 - 所以这里是完成/记录之前:
UINavigationController* savedUinvc = self.navigationController;
UIViewController *one = nil;
one = [savedUinvc popViewControllerAnimated:NO];
UIViewController *two = nil;
two = [savedUinvc popViewControllerAnimated:NO];
UIViewController *three = nil;
three = [savedUinvc popViewControllerAnimated:YES];
关于ios - ios8、popToViewController 和 UIViewControllerHierarchyInconsistency 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25832977/
大家好,我正在学习 Swift,在这里需要一些帮助。 用户正在注册并选择了他们的图片。关闭图像选择器后,我想让 ComposeViewController 出现。 代码如下: func imagePi
在我的 rootViewController 之后,有一个像这样的工作流程 viewController1 -> push viewController2 -> push viewController
我是 Swift 和 iOS 开发的新手,但我认为我知道如何使用它。我在尝试使用 popToViewController 时遇到问题。问题是我想在按下按钮时“清除” UINavigation 堆栈。所
我正在使用以下代码: @IBAction func popToRoot(sender:UIBarButtonItem){ navigationController.popToViewCont
我在第三个 View Controller 中推送了三个 View Controller ,我使用了语句 [self.navigationController popToViewController:
按下发布按钮时,将执行以下功能。在该函数中,使用 Parse 后端检索的所有对象都将附加到 groupConversation 数组中,该数组是一个全局数组。但是,当我引用在函数末尾弹出的 UITab
我正在尝试导航到另一个 ViewController,但它没有通过 segue 连接,所以我对导航栏进行了编程,我想要的是当你按下名为“重新开始”的按钮时,我请求的 ViewController 出现
我正在调用 UINavigationController 的 popToViewController 选择器,但它没有任何效果。该应用程序不会崩溃或卡住,当前 View Controller 上的所有
我正在使用导航 Controller 。我有(根,A,B,C,D)类。我想打磨绳子测试值(value)等级 电话 上课一个 通过 popToViewController。 请给我建议。 谢谢 最佳答案
我已经使用 Xcode 4.5 开发了应用程序。并在此应用程序中使用 UIStoryboard。 在这个应用程序中,我从一个 ViewController 推送到第二个 ViewController,
我有一个 CoreData 应用程序,其中包含 MainView 和 UITableViewController,其中包含列表中的所有项目。我想要完成的是添加自定义后退按钮并使用 popToViewC
我有一个导航 Controller 堆栈,比方说 A(root)->B->C->C->C->C->D。现在我想点击 D 中的一个按钮将我直接弹出到 B。引用 Stackoverflow 上的一些解决方
我有个小问题。我正在使用导航 Controller 中的 View Controller 开发一个简单的应用程序,如下所示:A->B->C(-> 是模态转场) View A 是 Root View C
我正在使用 UINavigationController 来处理 Controller 导航 在正常情况下 注册 View ->登录 View ->主页 View 在 HomeView 和任何其他下一
我正在尝试弹出一个我认为位于索引 0 处的 View Controller 。我的 View Controller 名称是 HomeVC。 self.navigationController!.po
如主题所述,调用 popToRootViewControllerAnimated/popToViewControllerAnimated 不再执行任何动画。 我使用的代码在 4.x 上运行良好,很简单
又是我——学得很快。问题很简单,我有这样的控制 View :[初始]->[未记录]->[注册]现在注册后我被双重解雇了,这真的很难看!我不想直接从注册进入初始页面。我尝试了这段代码,但遗憾的是它关闭了
我有 3 个 View Controller ,A->B->C,但在 B 和 C 之间我有一个导航 Controller 。我的 C Controller 正在从用户那里获取一些信息,我将其保存在 R
我试图搜索这个,但找不到任何完美的解决方案。我的应用程序有自定义动画 View 和两个侧抽屉。我也有自定义导航 Controller ,它有滑动顶栏。从 appDelegate 我将第一个 Contr
我正在和我的团队成员就 popToViewController 发生争执。 对我来说最好的方法是 Can i pop to Specific ViewController? 但是他认为我们应该创建一个
我是一名优秀的程序员,十分优秀!