【问题标题】:UIViewControllerHierarchyInconsistency issue in ios6 for tabbarcontrollerios6中用于tabbarcontroller的UIViewControllerHierarchyInconsistency问题
【发布时间】:2013-02-14 07:16:49
【问题描述】:

我的应用程序在 iOS5 中运行良好,但当我切换到 iOS6 时,由于 UIViewControllerHierarchyInconsistency 而崩溃。

错误如下所示:

UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UILayoutContainerView: 0xa148de0; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0xa148ea0>> is associated with <UITabBarController: 0xa64af30>. Clear this association before associating this view with <lkViewController: 0xa33faa0>.'

我查看了 stackoverflow 上的一些解决方案,它告诉我删除视图控制器。但是当我删除 tabbarcontroller 时,视图显示不正确。

我的 xib 文件如下所示:

在这方面需要一些指导..谢谢...

编辑:

崩溃出现在 lkViewController 中的这一行:

self.view = m_tabBarController.view;

当 m_tabBarController 是 UITabBarController 时。

【问题讨论】:

  • 什么是lkViewController,您在哪里使用它?您要么错误地将某些东西连接到其视图出口,要么将错误的视图设置为其视图属性。
  • lkViewController 是一个 UIViewController...

标签: ios ios6 uitabbarcontroller


【解决方案1】:

改变

self.view = m_tabBarController.view;

[self.view addSubview:m_tabBarController.view];

将解决问题...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-09
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多