我读到关于另一个遇到类似 error 的用户的信息, 但这个错误是在不同的情况下。
我最初添加 View Controller 时收到此消息:
Unbalanced calls to begin/end appearance transitions for
<UITabBarController: 0x197870>
应用程序结构如下:
我有一个 5 个选项卡的 TabBarController 链接到 5 个 View Controller 。在初始显示选项卡中,我调用了一个新的 View Controller 来叠加作为应用程序的介绍。
我使用这段代码来调用介绍 View Controller :
IntroVC *vc = [[IntroVC alloc] init];
[self presentModalViewController:vc animated:YES];
[vc release];
此IntroVC
View Controller 出现后,出现上述错误。
附注我正在使用 xCode 4.2 和 iOS 5.0 SDK,开发 iOS 4.3 应用程序。
最佳答案
在没有看到更多周围代码的情况下,我无法给出明确的答案,但我有两个理论。
您没有使用
UIViewController
的 designated initializerinitWithNibName:bundle:
.尝试使用它,而不仅仅是init
。此外,
self
可能是选项卡栏 Controller 的 View Controller 之一。始终从最顶层的 View Controller 呈现 View Controller ,这意味着在这种情况下要求选项卡栏 Controller 代 TableView Controller 呈现覆盖 View Controller 。您仍然可以保留对真实 View Controller 的任何回调委托(delegate),但您必须让选项卡栏 Controller 存在和关闭。
关于ios - 对 <UITabBarController : 0x197870> 的开始/结束外观转换的不平衡调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7886096/